0

Create an HTML file consisting of the following single line:

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>

Does your console give the classic error that jQuery isn't defined? If so, why? If not, why does it do that to me, on both my laptop and when I view the page on iPad? The only thing the two have in common is the same WiFi network.

I really hate to be asking an apparent duplicate (JQuery - $ is not defined), but none of the supposed only possible causes listed in that answer seem to apply to me. The scripts aren't in the wrong order because there's only one of them. Firebug claims the script loaded with "304 - Not modified", so that's not the issue.

I've tried it with multiple versions of jQuery and gotten the same result. It's especially frustrating because I've used jQuery with no trouble in ages past, and now I'm stumbling over something really basic. Does "naked" jQuery just have this problem, and the browser needs something else to munch on that actually uses jQuery or else it returns this error?

Community
  • 1
  • 1
Lenoxus
  • 545
  • 1
  • 4
  • 19

2 Answers2

1

JQuery UI requires JQuery to be included first.

From the Google CDN https://developers.google.com/speed/libraries/devguide

This library depends on jQuery. You must also load jQuery before loading this module.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js" type="text/javascript"></script>
jeff_kile
  • 1,805
  • 16
  • 21
1

don't you think, that jquery itself would be needed as well ?

ddlab
  • 918
  • 13
  • 28
  • oh good lord. I thought that was jquery. I'd forgotten I'd ever used jquery ui, and just went by the combination of "my browser remembers the address" and "it's Google, so it's jQuery; all the jQuery extensions are non-Google." – Lenoxus Feb 08 '14 at 00:18