Languages

Menu
Sites
Language
Can't find variable: jQuery

For some reason I can't seem to get jQuery working in a project I'm working on. It works fine from both a virtual host and direct from my localhost. But when I try and import the project into Tizen, both in the Simulator and my real device, I get the following in the console:

--------- beginning of /dev/log_main

js/swipe.min.js (1) :ReferenceError: Can't find variable: jQuery

js/player.min.js (1) :ReferenceError: Can't find variable: $

I know what this error means normally, jQuery isn't loading properly. However, enough of the app works for me to know that it is being loaded. For example I have an active state that I set via class on some thumbnails and it is swapped through them as you click on one. All this is being done using jQuery methods. But I get this error and most of the app doesn't load, specifically video and images. These work as well on any other platform or host that I setup to test them on.

What is happening to trigger this error?

 

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

4 Replies
Raghu Kona
Have you tried creating a jQuery project in Tizen IDE and loading the required files into the project?? Coz as you said, the error just says it can't load jQuery or was unable to locate the jquery.mobile-x.x.x.js. Regards, Raghu Kona
Jasper Valero
This isn't a jQuery mobile project, it merely used jQuery 1.9.1. We don't need or want to use jQuery mobile for this project. I'll try porting it over into the project templat e generated by the jQuery mobile project, but it won't and can't be the final solution. It will allow me a cross reference if does however work. I'll let you know how things go.
Jasper Valero
Porting it over to the jQuery mobile template seemed to work. In trying to reverse engineer the problem, I tried using the jQuery 1.7.1 which was included with the template. This did work. When I made one change to try and use jQuery 1.9.1 it doesn't work. So I'm guessing it is an issue with support for versions of jQuery above 1.7.1? Does that make sense? One thing I didn't check is if it was a dependency issue of the current version of jQuery mobile the template pulls in.
Raghu Kona
As per the Tizen 2.0 release notes "jQuery and jQuery Mobile (jQM) versions are upgraded to jQuery 1.8.2 and jQM 1.2.0" I think, the versions thereafter are not tested yet and may not be fully supported. It is recommended to use the supported version mentioned in the release notes. Regards, Kona