Uncaught ReferenceError: $ is not defined
Permalink Browser Info Environment
Thanks for publishing this great add-on for free. Unfortunately for me, I get an "Uncaught ReferenceError: $ is not defined" javascript error when I am not logged in to my site. I suspect this is because when the user is not logged-in, I concatenate and minimise all the JS libraries, and load them at the foot of the page to speed up the site (I also use sass and gulp). I'm no JS expert but I'm guessing that the error is because your add-on script uses JQuery, which is not loaded when your script runs.
I note your comments about needing to load your script in the page due to caching issues, so I'm wondering if you know of any easy solution to my problem? For example, are you using JQuery for much more than ID targeting and if so, could these few lines be replaced with vanilla JS?
I note your comments about needing to load your script in the page due to caching issues, so I'm wondering if you know of any easy solution to my problem? For example, are you using JQuery for much more than ID targeting and if so, could these few lines be replaced with vanilla JS?
Type: | Pre-Sale |
---|---|
Status: | Resolved |
Hi,
Sorry I was unable to answer your question yesterday as I am currently away on holiday until the 15th.
I'm glad to hear that you have managed to sort out the issue and I will take a look at the SO link you provided and apply any necessary updates.
Any other questions, please feel free to contact me again and I will try my best to get back to you as fast as possible.
Regards,
Adam
Sorry I was unable to answer your question yesterday as I am currently away on holiday until the 15th.
I'm glad to hear that you have managed to sort out the issue and I will take a look at the SO link you provided and apply any necessary updates.
Any other questions, please feel free to contact me again and I will try my best to get back to you as fast as possible.
Regards,
Adam
http://stackoverflow.com/questions/799981/document-ready-equivalent...
Might I suggest that you consider adding the wrapper to your add-in code.
Thanks again for publishing your work :)