facebook

AJAX from offline app

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #316414 Reply

    janosh
    Member

    Hi
    I have created a test app with 2 pages: main.mobi and page1.mobi.
    On second page I have a button with the link: javascript:getDataFromServer();
    In the main_custom.js I have defined this function using jQuery’s method
    $(‘m1-page1-text1’).load(‘www.myserver.com/getdata.php’); this actually does an Ajax call an updates the HTML of the text1 div.
    I have also set the application as Offline App and configured the manifest file with correct mime type.
    Then I have uploaded the HTML files to my webserver http://www.myserver.com.

    Testing:
    Calling the App with Safari browser works perfectly. The AJAX call properly loads the data into the text1 div on page1.
    Calling the App on iPhone, added to Homescreen, the AJAX call does not work any longer.

    Is the JQuery’s load() method not OK for this purpose?
    How can I combine an offline App (for some pages using the cache) and still using ajax calls for getting some actual data, if the user is online?

    thanks a lot and regards,
    Janosh

    #316418 Reply

    janosh
    Member

    I just found out that I have to add the .php file which I call via Ajax to the NETWORK section within the manifest file.
    That way it seems work fine on iPhone too.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: AJAX from offline app

You must be logged in to post in the forum log in