Results 1 to 5 of 5

Thread: jQuery Confliction Issues

  1. #1
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default jQuery Confliction Issues

    I am getting error when prototype.js & one other js both are in a same page.
    What should be the solution?

    Actually I am having a slider in a page that is using a js file named "all.js" & in that page drop-down menu is there.
    pls. see http://eagle.arvixe.com/~houselav/in...l-gallery.html (In this page “Shop” menu is having a drop-down menu).

    Now when including "all.js" file if I write jQuery.noConflict(); after including "all.js" then slider stops working & if I do not write no-conflict() after including "all.js" then drop-down menu stop coming.

    Any solution?

    Thanks.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Is all.js only for the slider? If so, get rid of it, it's a pile of ****. Find another script for a slider, there are at least 1000's.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default jQuery Confliction Issue

    Thanks jscheuer for your reply but can you look into script? & can you give solution for it?

    Yes all.js is only for the slider.

    If I write jQuery.noConflict(); after including "all.js" then error comes -
    $(b) is null
    [Break On This Error] eval(function(p,a,c,k,e,r){e=function(...r|try|area|firefox'.split('|'),0,{})).

    If I do not write jQuery.noConflict(); after including "all.js" then error comes -
    element.dispatchEvent is not a function
    [Break On This Error] element.dispatchEvent(event);
    prototype.js (line 4079)
    uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMXPathEvaluator.evaluate]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: http://eagle.arvixe.com/~houselav/js...e/prototype.js :: anonymous :: line 1528" data: no]
    [Break On This Error] Selector._div.querySelector(this.expression);

    Any Solution please because I can not use any other script. I have done this slider with a huge difficulty & now it would be good if I do not require to change it.

    Please.

    Thanks.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I did look into it. I even 'fixed it'. The problem though is that it is designed for a multitude of uses and you're only using one thing. The same thing apparently with Prototype. It's absurd to use so much code for a single drop down, likewise for a simple slider. And one library or the other (Prototype or jQuery) can easily handle both tasks - generally any javascript tasks for a website. And one version of jQuery - if that's the one you choose, should be sufficient.

    Further, even when the slider is working, it has issues in IE 9 and Opera - even more reason to get another slider. This may be due to the fact that even when jQuery is in noConflict mode it sometimes is still not 100% compatible cross browser with other versions of itself and/or other libraries. Or it may be simply a problem with the slider code in and of itself.

    All that said, here's the 'working' noConflict version of all.js:

    Attachment 4188

    You may use it followed by:

    Code:
    <script type="text/javascript">jQuery.noConflict();</script>
    But, as I say - I recommend scrapping it and most of the scripts on the page. Rethink what you're doing script wise and try to find a smaller amount of truly cross browser code for your purposes.

    How did you end up picking all these scripts and code anyway?
    Last edited by jscheuer1; 11-09-2011 at 05:07 AM. Reason: add detail on slider's issues
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2011
    Posts
    13
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Smile jQuery Confliction Issue

    Thank you Jscheuer for your all help. I really appriciate your help.
    You are awesome. Now all the thing is working correctly.

    Actually my client wanted this kind of slider. I searched through the web a lot but unfortunately I could not get.

    So finally I got this js file directly from "http://www.vogue.com/parties/desiree-rogers-hosts-dinner-at-chicagos-pump-room/". So my slider started working but initially I did not look for this problem then client told me.

    Now with your modified file, all the things are working properly.

    Thank you very very much Jscheuer.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •