Storing and Displaying JavaScript
This is an open discussion with 4 replies, filed under General.
Search
I have written an extension, JavaScript Textarea to do this
On the displaying front, My Firebug Net panel shows the headers are returning
Content Type: text/html
Any way to get this to return
Content Type: text/javascript
edit: Got this to work using Ashooners Content Type Mappings
I seem to be having a conversation with myself! lol.
@designermonkey
Just FYI, my Content Type Mapping extention is just a fork of Alistair’s (which is the one you linked to) that added Content-Disposition functionality, which I’m not sure you’ll need. You’ll probably want to use his if you aren’t, since he’s probably maintaining it better than I am ;).
edit: Nevermind, I hadn’t realized Alistair had pulled in the content-disposition function.
@ashooner, I’m going to add something similar into my extension, to make sure peeps can output without too many plugins…
Thanks though!
Create an account or sign in to comment.
I’m trying to store JavaScript in the database via a textarea. I’ve wrapped it in a CDATA wrapper to stop it being parsed but storing the code sanitises && operator to &&, even in the CDATA wrapper.
Is there any way to stop this from happening??
When I output my script, it still has && in it.