Title: WordPress &#8220;texturizes&#8221; my javascript &#8230;
Last modified: August 18, 2016

---

# WordPress “texturizes” my javascript …

 *  [blakekr](https://wordpress.org/support/users/blakekr/)
 * (@blakekr)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/)
 * … even when I have the text control format set to “No Formatting” and “No Character
   Encoding.”
 * When I place javascript inside my post even with those enabled, it turns the 
   ampersands into `&#138s` (or whatever). How do I get around this? It isn’t a 
   universal type of javascript I can put in the template.
 * Thanks, I appreciate your suggestions!

Viewing 13 replies - 1 through 13 (of 13 total)

 *  [kickass](https://wordpress.org/support/users/kickass/)
 * (@kickass)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325218)
 * Are you using the cdata thingies? Wrapping them around javascript makes them “
   translate literally”.
 * [http://www.w3schools.com/xml/xml_cdata.asp](http://www.w3schools.com/xml/xml_cdata.asp)
   
   [http://www.w3.org/TR/REC-html40/appendix/notes.html#notes-specifying-data](http://www.w3.org/TR/REC-html40/appendix/notes.html#notes-specifying-data)
 *  Thread Starter [blakekr](https://wordpress.org/support/users/blakekr/)
 * (@blakekr)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325220)
 * Thanks, K. I tried your suggestions but I’m still not there. I haven’t used CDATA
   before but I tried inserting it the way the w3schools document suggested. For
   output I got a javascript “syntax error” for the “<![CDATA[” line, and WordPress
   still texturized the ampersands.
 * I wasn’t sure what to take from the second document, but I tried escaping the
   amps with backslashes. I wasn’t successful though.
 *  [kickass](https://wordpress.org/support/users/kickass/)
 * (@kickass)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325227)
 * There’s more than one way to do the cdata things. I’d google it and see if another
   way helps. Also, if you’re using 2.0 you might try turning off that editor and
   using the simpler editor in advanced mode.
 * And I’m sure vkaryl will be chiming in on this eventually, she’s the one who 
   clued me in to there being more than one way to do the cdata stuff.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325241)
 * Yup. It depends on the script itself, and sometimes on server settings apparently(
   which is stupid, but the only thing I could figure out when it worked one way
   on one server and another way elsewhere – may have something to do with tweaks
   to apache modules, or the dif between apache and windows servers, though I don’t
   have windows servers at all….)
 * This is what I’ve had luck with (within wp):
 * `<script type="text/javascript">
    //<![CDATA[ <!-- your script code goes here//--
   > //]]> </script>
 * I don’t think the `{literal}{/literal}` tagset will be of any help; then again,
   if you still have problems and want to try that, here’s what works within templating
   engine pages (which are not wp):
 * `<script type="text/javascript">
    //<![CDATA[ {literal} <!-- your script code
   goes here // --> {/literal} //]]> </script>
 * One other thing to note: sometimes a bork in a js call (in wp I’m talking about)
   will happen because the lack of white-space interferes somehow with the parser.
   Try giving each element its own line…. similar to how I have it shown above.
 *  Thread Starter [blakekr](https://wordpress.org/support/users/blakekr/)
 * (@blakekr)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325248)
 * Thanks, vkaryl. I didn’t get errors with the cdata anymore using your code, but
   WP STILL went in and converted all my ampersands – ARRRRRGH. I must have one 
   of those hopeless server configs. Thanks for trying, I really appreciate it.
 *  [billsaysthis](https://wordpress.org/support/users/billsaysthis/)
 * (@billsaysthis)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325254)
 * I’m having a similar issue, though without the use of the plugin. According to
   the codex page ([http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)),
   I should be able to insert a script call directly in the post. However, when 
   I save the post the call is truncated to
 * `<script type="text/javascript"> </script>`
 * IOW, the src=”myscript.js?p1=xxx&p2=yyy” is removed.
 * Any suggestions for a fix/workaround, or do I need to install Jeff’s plugin?
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325256)
 * Is this a call to an external js file? Or inline? And are you using 2.0, and 
   the wysiwyg?
 *  Thread Starter [blakekr](https://wordpress.org/support/users/blakekr/)
 * (@blakekr)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325258)
 * I’ve tried it both ways, inline and external. I’m using 1.5.
 * Believe it or not, although this sounds crazy, there seems to be some kind of
   conflict between the javascript source and some kind of javascript affecting 
   wordpress’s browser scroll bar??? The conflict doesn’t arise if I call the script
   as an external SRC file, until I click on the far right-hand scrollbar to move
   up or down, and then it throws an error — both in the edit window, and the “view
   site” side of the page as well. Totally bizarre.
 * This doesn’t happen at all when I call the script outside of wordpress.
 *  [billsaysthis](https://wordpress.org/support/users/billsaysthis/)
 * (@billsaysthis)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325261)
 * _Is this a call to an external js file? Or inline? And are you using 2.0, and
   the wysiwyg?_
 * My script is external and I’m using 2.0 (don’t know how to turn off wysiwyg other
   than popping up the HTML box, which doesn’t help, so am using it). The script
   absolutely works when used elswhere and even in a 1.5.2 blog I have inside the
   firewall here.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325270)
 * Turn off wysiwyg in your user page at the bottom if you don’t want to use it.
 * This sort of thing happens with xml-rpc, video, etc. as well – stripping code
   I mean. Try a google site: search for xml-rpc, or audioblog, or ryan’s fix – 
   should turn up several relevant threads, with some information about mitigating
   the situation.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325272)
 * blakekr – as you may note, this board itself has the same problem as far as unescaped
   characters. I would say that this is something that only the devs could fix, 
   and I wouldn’t venture to make a guess as to how likely that would be.
 *  [billsaysthis](https://wordpress.org/support/users/billsaysthis/)
 * (@billsaysthis)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325273)
 * vkarl, thanks so much, that was exactly what I needed.
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325274)
 * You’re welcome!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘WordPress “texturizes” my javascript …’ is closed to new replies.

## Tags

 * [ampersand](https://wordpress.org/support/topic-tag/ampersand/)
 * [control](https://wordpress.org/support/topic-tag/control/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [plug](https://wordpress.org/support/topic-tag/plug/)
 * [text](https://wordpress.org/support/topic-tag/text/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 13 replies
 * 4 participants
 * Last reply from: [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-texturizes-my-javascript/#post-325274)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
