Search code examples
androidcordovajqtouchzepto

JQTouch error with phonegap


I'm trying to get jqtouch zepto to work with phonegap. I'm using android to test. I have the project set up and both js frameworks loading but I get this error when setting up jqtouch

 TypeError: Result of expression 'a' [undefined] is not an object. at file:///android_asset/www/jqtouch.min.js:7

And this is the error for the non min js jqtouch.

TypeError: Result of expression 'hash' [undefined] is not an object. at file:///android_asset/www/jqtouch.js:420

Here is what my header and initialization of jqtouch looks like

   <script src="zepto.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jqtouch.js" type="text/javascript" charset="utf-8"></script>
<script src="phonegap.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8">
$.jQTouch({
    icon: 'jqtouch.png',
    statusBar: 'black-translucent',
    preloadImages: []
});
</script>

Solution

  • As I understand your question this is before you even have compiled your project. If you have just imported jqtouch.min.js and jqtouch.js and Eclipse is saying there is an error in them you can set Eclipse to ignore the file for errors.

    1. Go to : Project->Properties->JavaScript->Include Path->Source-> Excluded Groups
    2. ignore specific files by adding **/jqtouch*.js

    enter image description here

    This will make Eclipse ignore the supposed errors in jqtouch.js and jqtouch.min.js and make you able to compile your project.