3 ms·
Why even bother using a script tag if you're just going to eval the text later? Just make it a text file so you don't have to worry about stripping or escaping
by tlrobinson 17y ago
Why even bother using a script tag if you're just going to eval the text later? Just make it a text file so you don't have to worry about stripping or escaping comments.
- litewulf 17y agoI assume you want to include it in the same page to pipeline everything. Using a script tag is relatively safe because search engines tend not to look inside it, and unrecognized languages are typically ignored. (Though in this case, they don't specify a language, and thus comment it out for browsers that assume a default of javascript). A textarea would be a bit difficult because you'd need to escape characters correctly and such.