Apache Cordova
  1. Apache Cordova
  2. CB-2904

Problem with jQTouch in initilization

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.5.0
    • Fix Version/s: 2.7.0
    • Component/s: iOS
    • Labels:
      None
    • Environment:

      Description

      Hi There,
      With version 2.5.0 (i can't report for versions between 2.2 and 2.4 since i've upgraded from 2.2 to 2.5 directly) jQTouch seems to not initialize correclty.

      Normally jQTouch it's initialized with:

      var jQT = new $.jQTouch({});
      

      Outside the:

      document.addEventListener("deviceready", onDeviceReady, true);
      
      // PhoneGap is ready
      function onDeviceReady() {
        dosomething();
      }
      

      Now it's not working the app hang on splashscreen, if we put the initialization inside the "onDeviceReady" the app start but the global jQT object it's not seen inside the code.

      I've been suggested by Shazron to file a bug here.
      Thanks a lot Ciao
      Rob

        Activity

        Hide
        Roberto added a comment -

        Hi Shazron!
        Got it working... Well it was simple btw.
        I've create a global variable:

        var jQT = null;

        In my init.js file prior to call the jQT initialization INSIDE the ondeviceready function.
        So the jQT object it's correctly initialized and seen on all .js code (globally in app).
        I dunno but something it's changed in cordova.ios.js that make initialization of jQT unstable with jQuery.
        Thanks a lot! Ciao
        Rob

        Show
        Roberto added a comment - Hi Shazron! Got it working... Well it was simple btw. I've create a global variable: var jQT = null; In my init.js file prior to call the jQT initialization INSIDE the ondeviceready function. So the jQT object it's correctly initialized and seen on all .js code (globally in app). I dunno but something it's changed in cordova.ios.js that make initialization of jQT unstable with jQuery. Thanks a lot! Ciao Rob
        Hide
        Roberto added a comment -

        Hi Shazron,
        Sorry my fault not specifiyng i'm using jQuery not Zepto.
        I'm trying to debug with the function You provided here:

        window.onerror = function(err,fn,ln)

        {alert("ERROR:" + err + ", " + fn + ":" + ln);}

        ;

        A Guy in stackoverflow suggested a workaround please see:

        http://stackoverflow.com/questions/15732567/phonegap-2-5-0-jqtouch-fail-inizialize/16005380?noredirect=1#comment22845664_16005380

        I can't get out of the reference error btw! Thanks a lot! Ciao
        Rob

        Show
        Roberto added a comment - Hi Shazron, Sorry my fault not specifiyng i'm using jQuery not Zepto. I'm trying to debug with the function You provided here: window.onerror = function(err,fn,ln) {alert("ERROR:" + err + ", " + fn + ":" + ln);} ; A Guy in stackoverflow suggested a workaround please see: http://stackoverflow.com/questions/15732567/phonegap-2-5-0-jqtouch-fail-inizialize/16005380?noredirect=1#comment22845664_16005380 I can't get out of the reference error btw! Thanks a lot! Ciao Rob
        Hide
        Shazron Abdullah added a comment -

        Definitely not a Cordova API problem - but I solved it (ice ice baby). Included the zepto script before you include the jqtouch script.

        Show
        Shazron Abdullah added a comment - Definitely not a Cordova API problem - but I solved it (ice ice baby). Included the zepto script before you include the jqtouch script.
        Hide
        Shazron Abdullah added a comment -

        This is not a Cordova API problem. I used jQTouch and Zepto, with no Cordova scripts loaded, it throws an exception (undefined). External issue.

                <script type="text/javascript" src="jqtouch.min.js"></script>
                <script type="text/javascript" src="zepto.min.js"></script>
                <script>
                    window.onerror = function(err,fn,ln) {alert("ERROR:" + err + ", " + fn + ":" + ln);};
                    var jQT = new $.jQTouch({});
                </script>
        
        
        Show
        Shazron Abdullah added a comment - This is not a Cordova API problem. I used jQTouch and Zepto, with no Cordova scripts loaded, it throws an exception (undefined). External issue. <script type= "text/javascript" src= "jqtouch.min.js" ></script> <script type= "text/javascript" src= "zepto.min.js" ></script> <script> window.onerror = function(err,fn,ln) {alert( "ERROR:" + err + ", " + fn + ":" + ln);}; var jQT = new $.jQTouch({}); </script>
        Hide
        Shazron Abdullah added a comment -

        Testing using jQTouch 1.0 beta 4 rc, and Zepto 1.0

        Show
        Shazron Abdullah added a comment - Testing using jQTouch 1.0 beta 4 rc, and Zepto 1.0
        Hide
        Roberto added a comment -

        Hi Shazron,
        I've modified it Thanks a lot!
        Ciao Rob

        Show
        Roberto added a comment - Hi Shazron, I've modified it Thanks a lot! Ciao Rob
        Hide
        Shazron Abdullah added a comment -

        jQT version? Amend the issue (Environment field)

        Show
        Shazron Abdullah added a comment - jQT version? Amend the issue (Environment field)

          People

          • Assignee:
            Shazron Abdullah
            Reporter:
            Roberto
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development