The following line in advanced-ajax-page-loader.php has broken the plugin for some time now… it hasn’t been working for me without this fix, while new versions keep coming up…
At line 215, replace all double quotes with single quotes and vice-versa, because the value returned by the PHP snippet (the URL path to jquery.js) is already enclosed in double quotes which otherwise don’t get escaped and break the code and the functionality of the plugin completely.
This is what the line should be:
Because of this error, the inline script in the head of pages doesn’t get executed and “variable not defined” errors come up, while ajax functionality doesn’t work.
I don’t need the jQuery check / loader / initializer, so I simply comment out the whole initJQuery() function definition and the following call to that function (within the PHP file).
I also remove everything from the jQuery document load event handler in ajax-page-loader.js except the call to AAPL_loadPageInit(“”);
This fixes the plugin version 2.5.9, but not the latest version (2.5.12).
The website using it can be found here.
It sounds like you have a problem with your wordpress install… Why would the plugin path coming from:
<?php echo plugins_url( “jquery.js” , __FILE__ );?>
return any quotes?!?!?! It is a PATH.
I have actually changed this in the latest version to use jQuery instead so maybe this will help in your case, I would check your installation path and made sure you did not include any quotes.
Let me know if this works.
I think I did a mistake by saying that WP returns a path enclosed in double quotes, that wouldn’t make much sense indeed. I was just confused when I examined the source code of the live page. That string appeared to be very wrongly escaped and thus breaking the entire script processing in my case (it invalidated the HTML), even with the jQuery check being disabled.
Anyway, I had disabled the plugin, deleted the plugin folder and uploaded version 2.5.12, then enabled it again, and it didn’t work at all, so I just reverted to 2.5.9. I update the plugin manually just to make sure I don’t lose my settings, and because I have to (it’s free hosting, the server limits max. execution time of PHP scripts to 10 seconds only).
I’ll try the latest version, revision 13, and return with results.
Is this only happening to me? Check this at indignat.socioblog.ro (clicking on the post excerpts’ titles doesn’t AJAX-load content), so the syntax error below breaks script execution (I was wrong again saying it invalidates HTML, but because it deals with HTML code generation):
You see, there is a double-quoted string (the jQuery path specified as the value for the SRC attribute) inside another double-quoted string.
It seems you’ve published revision 14 in the meantime. I’ll check that too a little later.
There’s also again the “AAPL_wanings is not defined” within the jQuery(document).ready at line:
if (AAPL_warnings == true)
right okay I understand,
the reason behind the jquery check is that some versions of wordpress do not come with jquery, others do come with it, and then some plugins include jquery themselves and either override the wordpress jquery (sometimes with a outdated version) and etc etc.
So because of this mess of conflict/missing/included under another namespace etc, I created the jqueryinit function which basically checks if jquery is around, and if so it will NOT DO ANYTHING.
But if jquery isnt around it will try and include it (and if its outdated it will try override it/show an error).
I killed my plugin so please try 2.5.15 in a moment when its released.
BTW – if you want to disable the jQuery check there is an option in the admin panel called “Enable jQuery check.”
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).
I appreciate your work and helping me, but you keep releasing revisions for every comma edit and I’m tired of re-updating the plugin manually everytime and testing it when it’s clearly not necessary. I suggested changing the enclosing quotes from the very beginning, and I’ve wasted the last hours only to return to that conclusion. I’m going to take a headache break to play some poker and come back later to test and report issues, if any.
I learned the same as you, but a few years ago now. I now work for a company and run my own freelance.
Could you please send me a link to your site so I can check this out (leave the problem there so i can see it).
I have no idea why you are having this problem. There should not be ANY quotes in there to cause the problem.
And sorry for the constant releases, I was at work and made a few mistakes as I wasnt able to test my code or concentrate as I would usually.
I will take a better look tonight while not at work, maybe your right and I’m missing the big picture.
I’m using Google Chrome version 21.0.1180.83
Thank you for taking the time.
omg your right!!
I have a test version on my blog where I fixed this, and I was failing to see the mistake! And because my other test blogs include jquery okay without that check everything works fine.
I will release a fix tonight.
I do apologise for arguing against you (and being so dumb not to see this), major fail on my part :/
- The topic ‘[Plugin: Advanced AJAX Page Loader] AAPL_warnings not defined’ is closed to new replies.