Reputation: 31
Whenever I add my webapp to the home screen and click on a link, it takes the user out of the web app and into Safari. The link is a home button, it takes the user back to the home page. The home page works fine, but it only leaves the app when I click the home button. The web app works fine on my Mac. Here is the code:
<a href="<?php echo"Home.php?name=$name";?>">Go Home</a>
Is something wrong with the php? I need the php so the query string will work. Thanks for the help.
Upvotes: 3
Views: 1953
Reputation: 31
The way I've done it on my standalone web app is:
<a href="javascript:(window.location='Home.php?name=<?php echo($name)?>')">Go Home</a>
This is a lot easier than rebuilding your entire web app with JQTouch, JQueryMobile, or Sencha. If you convert all of your links this way it wont't leave your app and go to Safari :)
Upvotes: 3
Reputation: 30996
Webapps need to be fully ajaxified. You cannot perform regular page reloads. I highly recommend a mighty JavaScript framework like jQuery, which simplifies the use of ajax and the required DOM-manipulation a lot.
EDIT: You can fetch a remote url using jQuery's highlevel $.get
-method like this:
$.get('Home.php', {
// query parameters
'name': 'some-name'
}, function(data) {
// data now contains the fetched page
});
Take a look at the jQuery Ajax API for further information If you never used jQuery before, you should look into some tutorials.
Upvotes: 1