dimanche 19 avril 2015

How to fix ReferenceError: Can't find variable: jQuery/$

I know, there are a lot of questions like this, but they doesn't help me.


My situation is following.



  1. I copy one (working) site with some changes to create another.

  2. After I did it with not so much changes javascript on new site doesn't work, saying "ReferenceError: Can't find variable: jQuery" and "ReferenceError: Can't find variable: $".


  3. I added into the code alerts:



    alert('aaa');
    var x=$('td[type="x"]').size();
    alert('aaa1');



and see "aaa" alert, but don't see "aaa".




  1. I've checked, like it is said here, with Safari's debugger that jquery files are found and loaded, I can see them in "Resources" tab.




  2. adding ready in the line doesn't help:



    alert('aaa');
    var x=$(document).ready($('td[type="x"]').size());
    alert('aaa1');



What else I can do about it?


I have OSX 10.10.3 and Safari 8.0.5.


Aucun commentaire:

Enregistrer un commentaire