Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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

by ikegami (Pope)
on Dec 07, 2006 at 02:22 UTC ( #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
Node Status?
node history
Node Type: note [id://588245]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2016-12-05 06:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (72 votes). Check out past polls.