I added this to my WordPress page
if (script.readyState && script.onload!==null){
script.onreadystatechange= function () {
if (this.readyState == 'complete') mce_preload_check();
}
}
and the && is being turned to
if (script.readyState && script.onload!==null){
I pasted this in WordPress HTML view and I made sure this was fine but WordPress keeps displaying this. How to address this?
You need to disable WP’s autoformatting. WP will auto format even in the html editor, and the spaces and line breaks will break your javascript.
Use this plugin http://wordpress.org/extend/plugins/wp-no-format/
Update 4/08/2015: plugin is dated but still works for me.
This also works: add the plugin directly to functions.php and bracket the your javascript in
<!-- noformat on -->and<!-- noformat off -->tagsAdd to functions.php file: