Tip - Using Backquotes when having html in text

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
keyur
Advanced
Advanced
Posts: 10
Joined: Fri Feb 13, 2009 11:39 pm

Tip - Using Backquotes when having html in text

Post by keyur »

Hello,

I was having trouble entering   in my text, (with an html link containing an = sign inside the text), and found this old tip from Andy that came in handy.

Code: Select all

aI("text=`<p>&nbsp;&nbsp;<a href='/index.html'>Hello</a>`;type=form;");
----
The system is smart enough to know that something like &nbsp; is a non-breaking space and so add this as a character without breaking the text string.

However, there are times when this may fail usually because you have included an equals sign as well as a semi colon. In this instance you would need to use back quotes, like this.

Code: Select all

    aI("text=`Here&nbsp; is an equal sign "="`;url=#");
Note the use of "Back Quotes" rather than a normal quote mark.

Hope this helps
Post Reply