>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

SPRY and jQuery load sequence

I've been using spry for a little while now and I like it's ease of use, that said I needed some auto complete functionality and since spry 1.5 isn't out or supported I decided to use jQuery.

I needed to load in 3 JS files:

SpryData.js
jquery.js
autocomplete.js (http://www.pengoworks.com/workshop/jquery/autocomplete.htm)

The auto complete JavaScript calls a function in jquery called

$(document).ready function

This is recomended for all jQuery functions, so i'm happy to keep it. The problem was that I kept on getting an error saying that the function wasn't defined. After looking through all the JS I could see that it was defined? After playing around with bits here and there I discovered that the SPRY SpryData.js file must be loaded before you call include the jQuery file.

As it took me a while to discover this I thought I would let you know.

Has anyone else found any qwerks?


 
Comments
Chris H's Gravatar yes, with version 1.4 of Spry you just need to load jQuery AFTER Spry.
i'm using the 1.5 Preview version though, and right now you can only use jQuery next to it if you call the jQuery.noConflict() function.
this turns off the use of $ in jQuery and lets Spry be happy. you can still use all the jQuery functions jQuery(document).ready etc.
# Posted By Chris H | 07/05/07 19:04 | Report abusive comment
Joshua Rountree's Gravatar @quiksilv - Thanks for the tip! I was having the same problem and before digging to deep I figured I'd try google and wala! you got it!
# Posted By Joshua Rountree | 08/12/07 02:06 | Report abusive comment
Joshua Rountree's Gravatar Actually, I spoke too soon - I tried what you said and am still getting "object doesn't support this property or method" regardless of where I include the spry framework.
Any tips?
# Posted By Joshua Rountree | 08/12/07 02:08 | Report abusive comment
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.