3

I have a file that i think is jQuery UI. It mentions jQuery in the code but it is condensed, so it's hard to tell.

I included both jquery1.6.2.js and custom.js. (confirmed that they are both loading properly)

There is a sliding image panel that works fine when both are included, although I do get the message: $ is undefined from my own code (not the custom.js)

I read somewhere that the problem might be that I need to not include jQuery, but that seems to disable the image slider. The $ function seems to work fine if I remove the custom.js, but then of course the slide doesn't work.

Any ideas?

2
  • maybe this is an old build of jquery UI and i need to update it? but i can't see how to tell which features i should add Commented Jul 20, 2011 at 21:24
  • 2
    My ESP is on the fritz today, so I'm going to have to ask you to present a testcase. Commented Jul 20, 2011 at 21:25

3 Answers 3

4

Make sure that your loading the jQuery library before you load any other JavaScript that relies on the jQuery library.

Sign up to request clarification or add additional context in comments.

Comments

3

Make sure to include jQuery then jQueryUI before any plugins.

Comments

0
  1. Load jQuery before things that depend upon it

  2. Make sure jQuery is bound to window.$ (might not be with noConflict)

From the statement:

the $ function seems to work fine if i remove the custom.js

Then I believe that either custom.js is loaded before jQuery or the problem lies in custom.js: in particular, it is likely muddling with window.$ -- through jQuery.noConflict or otherwise. However, a test-case is required to say more with confidence.

Happy coding.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.