PDA

View Full Version : How do I embed a single-quote?


mericson
10-16-2004, 07:06 PM
If I'm assigning an attribute with a javascript expression that requires an embedded single-quote, how do I do it?

For example I would like to create this string dynamically "foo[@id='bar'" where mypath=foo and val=bar

This example shows ^ where a single-quote should appear:

datapath="${mypath + '[@id=^' + value +'^]}"

d~l
10-17-2004, 04:18 AM
does escape character \ work in Laszlo scripts?

I tried posting the datapath syntax here with escape char but the escape character also works in the posting !

so precede single quote with \ in the syntax.

mericson
10-17-2004, 10:16 AM
Doh! Of course that works... for some reason I was thinking XML and didn't expect it to work, should have tried first.