Display name
Display name

Reputation: 225

jQuery Mobile with Intel XDK: Endless pageload, when getting cookie content on pageinit

Good evening,

I'm programming a mobile-app with intel's xdk. I never had problems until now.

Problem: I tried to get the content of a cookie when the page is initialised the first time.

$("#mainpage").on( "pageinit", function()
  { 
  intel.xdk.cache.getCookie( 'cookie_name' );
  }

I only have one index.html with subpages. You can get the error here:

http://jsfiddle.net/Gajotres/Q3Usv/

Make sure to check jQuery Mobile 1.2.0 on the left and run

You should see a endless loading page. That same happens, when I'm trying to get the content of my cookie on pageinit. I also tried pagebeforeshow, pagecreate, pagebeforecreate... nearly all events shown on the first image on this site:

http://www.gajotres.net/page-events-order-in-jquery-mobile-version-1-4-update/

UPDATE IN RESPONSE TO USER SUGGESTIONS:

SOLUTION

I finally solved it after working nearly a week meticulously on a solution.

Now for all other's, having the problem out of the XDK: Make sure you do not include jQ or jQM a second time and stay tuned which event you have to use.

Now for all developers, having the same problem I mentioned: The Intel XDK provides it's own events. One of them is:

document.addEventListener("intel.xdk.device.ready",onDeviceReady,false);

This event ensures, that you can use every feature of the Intel XDK. An getting the content of a cookie is one of it. Hope it helps because one week or even more time to struggle with that problem isn't that enjoyable.

Greetings and thank you all for reading and helping

PS: Can be closed!

Upvotes: 1

Views: 559

Answers (0)

Related Questions