homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Anything similar to EOD heredoc definitions in Javascript?

 2:16 pm on Jul 6, 2009 (gmt 0)


When defnining a variable in PHP you can avoid using slashes on every quote by using

is there anything similar in javascript or is escaping quotes the only way?



 7:36 pm on Jul 8, 2009 (gmt 0)

Not in the code directly, but you could store the data in a hidden input or div and access it's value or .innerHTML (respectively) if you have a really long bit of text/html to write.

There are some hacky ways of doing it with comments, but nothing I've seen is reliable across browsers.


 10:21 pm on Jul 8, 2009 (gmt 0)

ok I'll probably stick with escaping quotes


 11:06 pm on Jul 8, 2009 (gmt 0)

Or, singlequote the string itself ... that way you do not have to escape all doublequotes.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved