The CreatorCon Call for Content is officially open! Get started here.

How to show HTML variable code on UI Page?

Ram_n Botelho
Tera Contributor

Hi, how can a HTML variable code be shown on UI page?

It only shows with HTML tags and no_escape did not work.

Thanks

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Ram_n Botelho 

Both these solution will work and I have tested it

<g2:evaluate var="jvar_html">
		var html = '<p>This is my paragraph</p>';
		html;
		</g2:evaluate>

	 <script>
    document.write('$[jvar_html]');
</script>

OR

<g2:evaluate var="jvar_html">
		var html = '<p>This is my paragraph</p>';
		html;
		</g2:evaluate>

<g2:no_escape>$[jvar_html]</g2:no_escape>

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ram_n Botelho 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@Ram_n Botelho 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader