HTML editor corrupts Javascript
-
I’ve just run into a problem trying to incorporate a JS ad banner on one of our sites.
Basically, the WP rendering engine seems to be substituting UTF-8 HTML codes for some of the characters – but only in certain places. Thus some ampersands (&), but not others, are rendered as & and some primes (‘), but not others, are rendered as ‘ , causing the JS to fail.
Here’s a cut and paste of a sample of the code as it should be:
<script type="text/javascript"> var uri = 'http://impgb.tradedoubler.com/imp?type(js)g(########)a(#######)' + new String (Math.random()).substring (2, 11); document.write('<sc'+'ript type="text/javascript" src="'+uri+'" charset="ISO-8859-1"></sc'+'ript>'); </script>And here’s how the last line but one is rendered in the page source:
charset="ISO-8859-1"></sc'+'ript><strong>‘</strong>);Has anyone else run into this problem? And if so, has anyone worked out how to fix it?
Many thanks in advance. If I find a solution myself, I’ll come back and say so. 🙂
Dave
The topic ‘HTML editor corrupts Javascript’ is closed to new replies.