asynchronous-javascript

Defer loading of JavaScript - Uncaught ReferenceError: $ is not defined

爱⌒轻易说出口 提交于 2019-11-29 11:42:58
I use google code to defer loading javascript ( google pages ) But I have some inline javascripts such as: <script type="text/javascript"> $(function () { alert("please work"); }); </script> And this gives me: Uncaught ReferenceError: $ is not defined I think I need some function, which was triggered after jQuery was loaded and init my inline javascripts. But if there is another way, I will be glad. EDIT: Some of you are completely out of topic. Mahesh Sapkal was close. With this code I have no error, but still don't work <head> <script type="text/javascript"> var MhInit = NULL; // Add a

Defer loading of JavaScript - Uncaught ReferenceError: $ is not defined

纵然是瞬间 提交于 2019-11-28 05:13:45
问题 I use google code to defer loading javascript (google pages) But I have some inline javascripts such as: <script type="text/javascript"> $(function () { alert("please work"); }); </script> And this gives me: Uncaught ReferenceError: $ is not defined I think I need some function, which was triggered after jQuery was loaded and init my inline javascripts. But if there is another way, I will be glad. EDIT: Some of you are completely out of topic. Mahesh Sapkal was close. With this code I have no