Organizational Research By

Surprising Reserch Topic

Experts Most Trusted Topic


jquery prototype conflict


jquery prototype conflict  using -'jquery,autocomplete,prototypejs,accordion,conflict'

I am using the jQuery AutoComplete plugin in an html page where I also have an accordion menu which uses prototype.

They both work perfectly separately but when I tried to implement both components in a single page I get an error that I have not been able to understand.


  uncaught exception: [Exception... "Component returned failure code:
  0x80004005 (NS_ERROR_FAILURE) [nsIDOMViewCSS.getComputedStyle]"
  nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame ::
  file:///C:/Documents and
  Settings/Administrator/Desktop/website/js/jquery-1.2.6.pack.js ::
  anonymous :: line 11" data: no]


I found out the file conflicting with jQuery is 'effects.js' which is used by the accordion menu. I tried replacing this file with a newer version but newer seems to break the accordion behavior.

My guess is that the 'effects.js' file used in the accordion was modified to obtain the accordion demo output. I also tried using the overriding methods jQuery needs to avoid conflict with other libraries and that did not work.

I obtained the accordion demo from stickmanlabs.com.

And the jQuery AutoComplete can be obtained from jQuery site.

Has any one else experienced this issue?
    

asked Sep 14, 2015 by IFXMar
0 votes
23 views



Related Hot Questions



Government Jobs Opening

Hope this helps to clarify the situation.

answered Sep 14, 2015 by JuliennePend
0 votes

jQuery lets you rename the jQuery function from $ to something else to avoid namespace conflicts with other libraries.

You can do something like this

var J = jQuery.noConflict();

Details here: michaelshadle.com ‚ÄĒ jQuery's no-conflict mode: yet another reason why it's the best

answered Sep 14, 2015 by Euczvwqw
0 votes

I don't really see the reason for using both libraries at the same time in this case.

You can either use Prototype's (well, Scriptaculous' actually) Ajax.Autocompleter and ditch jQuery, or you can use jQuery's Accordion and get rid of Prototype.

Using both libraries at once is not really a good idea, because:

  1. They can cause conflicts.
  2. By including them both you force your users to download them both. Which is not bandwith friendly approach.
answered Sep 14, 2015 by AleCarmack

...