JQuery Issue

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 4 years, 4 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #26292
    dmhagger30
    dmhagger30
    Participant

    Hi – I can’t provide login details as this is a localhost project I’m working on. However, the issue I’m experiencing is that I have JQuery enabled on my footer and it does not allow the Ajax pro plugin to work. If I comment out the JQuery it works, but I need JQuery enabled for the site. How can I resolve? Attached please find the Javascript console output. Thanks!

    Attachments:
    You must be logged in to view attached files.
    #26294
    dmhagger30
    dmhagger30
    Participant

    Hi – I pushed my site to a test url and you can see the Ajax Search Pro issue: https://f7aee4de31.nxcli.net/fighters/ – scroll down to the search bar. If you look at the source you will see the issue. The search works in the admin, just need it to work on the site.

    Thanks!

    #26295
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    There is a duplicate jQuery script loaded on the very bottom of the site, that unloads all previous requirements, causing the problem: https://i.imgur.com/hVbfIt5.png

    Once you remove that, it will resolve the issues immediately.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26307
    dmhagger30
    dmhagger30
    Participant

    Hi Ernest – yes if I remove that, the search works, however it disables the owl carousel which requires JQuery. The JQuery in the footer is the only one I have added to the site, it’s not loaded anywhere else. How do I keep the owl carousel working as well as Ajax Search Pro?

    Thanks!

    #26313
    dmhagger30
    dmhagger30
    Participant

    Hi Ernest – just seeing if you had a solution for this that doesn’t break the other use of JQuery? I’m eager to get my site live.

    Thanks in advance.

    #26314
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Using two jqueries will eventually break other things as well, you should rather try to substituing the default one to that other one.
    You can try this option, it will probably resolve it, but I would still very strongly recommend not using multiple instances of jqueries at once.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #26332
    dmhagger30
    dmhagger30
    Participant

    Hi Ernest – that option did fix the issue. I’ll look into ways of just loading 1 jQuery, but I assume since AjaxSearchPro uses jQuery, I’d have to load a no-conflict with it somehow? If you have an idea of how to make AjaxSearchPro use the jQuery I load in the footer, let me know. Thanks!

    #26334
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Unfortunately that is not possible like that. The jQuery in the footer should be moved to the header, replacing the original wordpress jQuery. Noconflict does not help here either, as the original scope is still overwritten.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.