Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Free Nodelet gets templating features (', " and \)

by ikegami (Patriarch)
on Dec 07, 2006 at 02:22 UTC ( [id://588245]=note: print w/replies, xml ) Need Help??


in reply to Free Nodelet gets templating features

Oddly enough for templating features destined to be used in JavaScript, there's no modifier to interpolate a variable (say `title`) as a JavaScript literal.

For example, neither

var title = '`title`'; # Fails for titles containing ' or \.

nor

var title = "`title`"; # Fails for titles containing " or \.

work for all titles. The workaround:

var title = decodeURIComponent('`title%`');

Update: tye suggested `title"` in a later post.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://588245]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-03-29 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found