Instruction set reference
HIPE_OP_APPEND_TAG
Appends a new HTML tag element as the last child within the specified tag element.
- location: The parent element inside which the new tag will be appended.
- arg[0]: The tag type (e.g. span or button).
- arg[1]: An optional id string to uniquely identify the new element. The tag id can be used in conjunction with CSS style rules or later in conjunction with HIPE_OP_GET_BY_ID.
- arg[2]: Optional extra argument: if "1" is passed here, the server will reply with a HIPE_OP_LOCATION_RETURN instruction describing the newly appended tag.
Notes
When building up a table (or similar layout-intensive element) by appending td elements to it, keep the table hidden (use the display style property for this purpose) until it is complete. It will display faster overall, since Hipe will not have to keep recalculating and re-rendering the layout as you add your table cells.
The efficiency dividend from using arg[2] to get the location back without sending an additional instruction is rather minimal. Another way to get the same functionality is to send a HIPE_OP_GET_LAST_CHILD instruction to the same location immediately after appending the new tag.