PDA

View Full Version : Accordion Menu & JQuery .19



rfree190
01-16-2013, 09:26 PM
1) Script Title: Glossy Accordion Menu

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-glossy.htm

3) Describe problem: I've been using this script for a few years now, with out any problems. Today, the menu on one of my sites failed. Trouble shooting, it appears jquery updated to version 1.9, which my site dynamically picked up. The menu failed. The accordion portion of the menu now fails to expand when clicked. Is this something that may be fixed in a future update? I always prefer to use the most current version of any software, jquery included. I will have to go back to 1.8 until this gets fixed unless there is another fix.

Thanks!
Rick

ajfmrf
01-17-2013, 12:06 AM
I tried using version 1.9 and it worked fine here http://www.web-user.info/vic/accordion/1.html

I wonder what else could be going on.

That script uses the version 1.4.2 of jquery. why did your site pick up a new version? What would make the version from google change if you have one version being used

I would presume something else changed/was added that is the issue?

jscheuer1
01-17-2013, 01:56 AM
ajfmrf's demo of accordion w/ jQuery 1.9 does work. Perhaps there's some other problem. Or it might be browser specific. Any particular browser you're having a problem with?

If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.

rfree190
01-17-2013, 06:46 PM
I use this tag in my pages:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
It picks up the most current version of jQuery from version 1.#.
Getting the same results in IE and FF. Dropping jquery back to 1.8 seems to fix the problem.

jscheuer1
01-17-2013, 08:36 PM
Yes. And that's one way of dealing with the problem. Another would probably be to use migrate (addition highlighted):


<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.0.0.js" type="text/javascript"></script>

It brings back functionalities to jQuery that have been dropped. A benefit with this approach is that if you use a browser with console logging, it will log which dropped features are being used. That way one can update the code that uses the dropped feature(s).

I say only 'probably' though because if the main reason is something beside dropped functionality, migrate might not fix the problem and any logging it might do could be misleading.

But again, clearly the script works with jQuery 1.9, so there must be some other problem. Now of course jq 1.9 is involved, but there must be something else as well on your page, otherwise ajfmrf's demo wouldn't work.

Sometimes a newer version of jQuery uses a stricter syntax than an earlier version. I've seen this happen before. Where an earlier version might ignore excessive quotes used in a selector, a later version will not, resulting in that selector not working as expected.

Again though, it has to be more than just that, since ajfmrf's demo works. It does work in both those browsers (IE and Firefox).

Here's the link again if you missed it:

http://www.web-user.info/vic/accordion/1.html

Nice work Bud. :)