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.
|
---|