This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

jQuery conflict – duplicate jQuery loading

Home Forums Product Support Forums Ajax Search Pro for WordPress Support jQuery conflict – duplicate jQuery loading

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32909
    reno.verdi08reno.verdi08
    Participant

    Hi Ernest,

    We have our own jquery loaded at the head section, but since there is a duplicate jquery loading from the plugin, it causes some issue on the page.
    For example: some datepickers are not working.

    deregistering script like below helps remove one jQuery load from the plugin, but somehow plugin stops working (could not initiate search). Even if we match the jquery version 3.5.1 as well.

     add_action('wp_enqueue_scripts', 'remove_plugin_jquery');
     function remove_plugin_jquery(){
         wp_deregister_script('jquery');
     }

    I have tried using minified scope too but error still persist.

    Could you please advise?

    Thanks

    #32910
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi,

    The plugin does not load jQuery explicitly, it only sets the jquery script as dependency. Instead of deregistering the core jquery from wordpress, try replacing it with your own source without hard coding it to the header.
    There is still a chance it will not work, as the wordpress core UI and other essential scripts might be only tested with the jQuery version, which is integrated to wordpress.

    #32924
    reno.verdi08reno.verdi08
    Participant

    Thanks Ernest for the pointer, this is resolved.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘jQuery conflict – duplicate jQuery loading’ is closed to new replies.