-1

Sometime I get the following error

Uncaught ReferenceError: jQuery is not defined

but then without changing anything, I will not get the error, then after a while the error will start showing up again.

Is this a server issue, of how the files are getting served? Or is there something in my code I can change to avoid this?

Charles
  • 50,010
  • 13
  • 100
  • 141
FluxEngine
  • 11,920
  • 13
  • 52
  • 81
  • 1
    It could be a number of different issues. Inspect the resources using your browser's console to see whether or not jQuery loaded. It could be a timing issue or a server issue. More likely that it is a timing issue. – Kevin B May 24 '13 at 20:42
  • 1
    Show your code please – Mark U May 24 '13 at 20:42
  • 1
    put your jquery script reference as the first script ref at the head part of html – Royi Namir May 24 '13 at 20:42
  • 2
    Look at the console. There probably was a problem fetching the jquery file. – Denys Séguret May 24 '13 at 20:43
  • @dystroy the console is where I get that error, I went ahead and moved my jquery to the top of any file. So I will see if it that fixed it. – FluxEngine May 24 '13 at 20:49

1 Answers1

1

You probably get that error after clearing your cache when your browser has to reload that file. You might be trying to use the jQuery operator $ before jQuery gets loaded. Make sure jQuery is loaded before anything that uses it.

km6zla
  • 4,712
  • 1
  • 27
  • 49