Pergunta

I have a mobile app developed in worklight with a main HTML file. In that HTML file I load content from other HTML files using the load function of jquery.

<div id="myHeader" />
$("#myHeader").load("myHTMLs/myHeader.html");

Testing that app locally in the computer, with firebug I can see that the application makes a get request for getting the loaded file (myHeader.html).

But when I execute the application in the device, since the first time without connectivity, it works.

So, makes the jquery load function a GET request to the server or does it load the file locally?

Thank you.

Foi útil?

Solução

While testing in the Mobile Browser Simulator you are seeing the get request to the web resource because you are using the development server. On device, your app loads the file locally.

For building a multipage app using jquery please see: IBM Worklight - Page fragmentation

Testing Hybrid Mobile Applications: Testing Mobile Applications

Worklight Development server documentation: Worklight Development Server

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top