In my main html file, I'm including jquery.mobile-1.1.1.min.js and jquery.tmpl.min.js from common/js location.
However, when I try to launch the application, I'm seeing these 2 errors in chrome js console.
Uncaught TypeError: Cannot read property 'event' of undefined jquery.mobile-1.1.1.min.js:9
Uncaught ReferenceError: jQuery is not defined jquery.tmpl.min.js:3
After this, the jquery features work fine (via wljq.js) but none of the tmpl features are working (not tried any mobile specific features yet, but I'm guessing they probably won't work either).
I'm thinking maybe these 2 libs don't get loaded at all because of these errors. But I can't figure out why they're throwing these errors.
Here is the html snippet that I'm using to include these 2 libs.
I have verified and reverified that the files are present in the correct location and the filenames are correct in the html file.
If I should put in more information, please let me know and I can provide that.
Any help is greatly appreciated.
This topic has been locked.
Pinned topic Error loading jquery mobile and jquery tmpl libraries
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
SystemAdmin 110000D4XK2327 Posts
Re: Error loading jquery mobile and jquery tmpl libraries2012-08-29T19:46:58ZThis is the accepted answer. This is the accepted answer.Jquery mobile relies on jquery, so you'll need to include jquery in your project.
However, Worklight comes built in with a version of jquery, but it is referenced as "WLJQ". Can you try adding the following lines in the head of your html file to see if it resolves the problem?
<script> window.$ = window.jQuery = WLJQ; </script>