KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Inserting HTML via 4DSCRIPT without rendering special characters
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: March 3, 2006
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

The 4DSCRIPT command used in the HTML code (<!--4DSCRIPT/Method/Var-->) inserts the returned variable $0 into the HTML.

If the $0 variable starts with the char(1), $0 is treated as the HTML code. For example, if the value of the $0 variable is "<Row>", the value inserted into the HTML code will be "&#60;Row&#62;". Since in this case $0 is not defined as an the HTML string, characters such as "<<" are rendered as "<&lt;". To properly insert the "<Row>" HTML tag, $0 must be passed as char(1)+"<Row>".