Support » Plugin: Advanced AJAX Page Loader » [Plugin: Advanced AJAX Page Loader] getting it to work without adding jquery

  • Resolved Corey Ellis

    (@thesrpartners)


    I LOVE this plug-in. I have a ton of js running for a particular client. When the plug adds the jquery that is supplied w/ the plug it breaks the other scripts (because jquery is being called twice) but when I remove the line that adds jquery from the php file the plug doesn’t work anymore. Can you help me get it to work with jquery already loaded from the wp_includes?

    http://wordpress.org/extend/plugins/advanced-ajax-page-loader/

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Dean Williams

    (@deano1987)

    Hey Corey, please contact me on my email address:

    deano@resplace.net

    I will be happy to help you get this working.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Dean, if you’re going to be supporting this via email and not on the forums, please do us the favor of posting that in your ReadMe (in the FAQ?) so it’s easy for people to find.

    Plugin Author Dean Williams

    (@deano1987)

    Of course I will, but first I need to figure out the actual issue and fix it for her.

    I will then either release an appropriate update or share a solution for any specific problem that’s being caused for her.

    Thanks.

    Plugin Author Dean Williams

    (@deano1987)

    And I’m being supportive via the forums. I just cant fix a problem with no URL or any way to track what the problem is. Hence why I have asked for more personal discussion so we can rectify the issue as quick as possible.

    Be rest assured that any development will be posted back here.

    Plugin Author Dean Williams

    (@deano1987)

    Okay after looking into the problem a little there are a few obvious problems which I will explain below.

    But there is some unknown trouble too, javascript seems to stop working with some of the content on the page that isn’t even changing, such as the menu. JavaScript is complaining that functions are missing which is possibly due to the removal of some javascript or something missing between my jquery include and the default of her site.

    Anyway always remember these two rules…

    FIRST:
    ——
    Any inline javascript in the HTML being loaded via AJAX will be lost and not executed or even available on the page. This is a security feature I believe.

    SECOND:
    ——-
    If you have anything like a fancybox/lightbox for opening all images into a larger preview then these sort of things will not work with new HTML is loaded into the page. To combat this you have to recall the bindings when the ajax has finished loading the content.

    I will drop some more information into the FAQ as soon as I have time. Also working to help Corey get around these issues if I can.

    Plugin Author Dean Williams

    (@deano1987)

    The second point I think I can rectify by re-calling document.ready, but the first issue still counts and without some major work is unavoidable.

    Great work! I had a need for such a plugin for a long time ago
    I have the same problem as Corey… It would be nice to hear some solution for breaking of the other scripts 🙂

    Plugin Author Dean Williams

    (@deano1987)

    We have worked it all out, the only problem now is a plugin for royalslider.

    It’s instance needs to be destroyed and re-initialised once the ajax content has been loaded into the page… I’m just figuring out the code for that now and I will add a quickfix to the JS (so you can enable the fix easily).

    I have already added a way to not load the jquery if it is initialised already.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    Lead Plugin Wrangler

    Of course I will, but first I need to figure out the actual issue and fix it for her.

    The point isn’t that. If people are emailing you with the info, it doens’t help the next guy who may or may not have the same problem. Often all they see is this:

    OP: I have a problem!
    Dev: Email me!
    OP: Yay! You fixed it!

    … See how that’s annoying? 🙂 We want to encourage you to have the dialogue with the user here. That’s why these nifty support forums exist 😉 If you need to take it to email, for privacy reasons or whatever, we understand, but we ask that you come back and explain what happened. Which you did. And that’s awesome.

    Seeing an initial post of ‘Email me!’ sends up red-flags though.

    I’m having issues reloading the javascript content after the page is loaded.

    I am using a custom theme that utilizes a nivoSlider on the homepage and lightboxes on many other pages.

    Can you please provide some more documentation or examples on how you reload the bindings / javascripts in the ajax-page-loader.js file?

    Thanks so much for a great plugin.

    Plugin Author Dean Williams

    (@deano1987)

    Hey! Just saw your comment here and on my blog, it’s a little late over here in the UK so I will reply in details sometime tomorrow! I promise!!

    Plugin Author Dean Williams

    (@deano1987)

    Right okay the first thing you need to do is locate the code which binds the nivoSlider to the element on the page (the setup code).

    Once you have this you would usually drop it just after this code in the JS file:

    /////////////////////////////////////////
    // DROP YOUR RELOAD CODES BELOW HERE //
    /////////////////////////////////////////

    BTW I’m releasing an update in about 3 minutes, and then you will see the above marker in the JS file (doesn’t exist right now).

    Thank you! That helped. I’ve got all my custom JS reloaded and it seems to be working well. It seems like a shame to have to duplicate so much JS code but I’m not too worried about performance on this project. Thank you!

    Unfortunately, I am still fighting against one issue.. When navigating around the site, the custom menu is not updating the highlighted tab. I’ll do some digging on my own but figured I’d mention it. Is this something you’ve come up against?

    Thanks again!

    Also. Something else I’m experiencing. If I start on the homepage and navigate around, everything seems to work really well.

    However, if I start on a different page, when I try to load the homepage, it doesn’t seem to load the content successfully.

    Just mentioning it. I’ll continue debugging as well.

    Thanks!

    Hey Dean and everyone. Sorry for the many successive posts! I wanted to come back and report that I came up with a solution for the menu tab highlighting issue. It might be a nice addition if you want to merge it back into the main branch of the plugin.

    in ajax-page-loader.js , pageLoaderInit()

    // highlight the current menu item
    $('ul.menu li').each(function() {
    	$(this).removeClass('current-menu-item');
    });
    $(this).parents('li').addClass('current-menu-item');
Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘[Plugin: Advanced AJAX Page Loader] getting it to work without adding jquery’ is closed to new replies.