Quantcast
Channel: WordPress.org Forums » All Posts
Viewing all articles
Browse latest Browse all 119608

bitoolean on "[Plugin: Advanced AJAX Page Loader] AAPL_warnings not defined"

$
0
0

Using revision 16, the errors I mentioned above are still present.
You seem to have updated that code, but you haven't fixed the single quotes and double quotes enclosing issue. I think replacing single quotes with double quotes and vice-versa, as I did mention in the first post will solve the issue (in fact I know so because I've already done it and it worked).

jQuery('head').append('<scr' + 'ipt type="text/javascript" src="<?php echo plugins_url( "jquery.js" , __FILE__ );?>"></scr' + 'ipt>');

To sum up, because valid HTML needs to enclose attribute values in double quotes ("), you need to enclose the strings belonging to Javascript which are parts of HTML code within single quotes. PHP only interprets code within the PHP tags, and it is interpreted first and replaced with the actual path, so it doesn't matter which ones you use to enclose strings belonging to PHP code. Javascript has to use single quotes, because using double quotes would mean needing to escape every double quote within the HTML-part strings with a backslash. So, we have PHP and HTML usding double-quoted strings inside Javascript using single-quoted strings.

Then the javascript is syntactically correct and won't break execution.


Viewing all articles
Browse latest Browse all 119608

Trending Articles