I have a web app that I want to display as a standalone once a user has bookmarked it to the home screen of their device. I've been testing on an iPhone 5. I'm using the meta tags to make it display as a web app and a bit of jQuery to handle click events, keeping all the links within the standalone and preventing them from launching Mobile Safari. This is all nice and straightforward, until I tried to turn some of my boring text links into image links. The preventDefault() action can't seem to handle the image links and always returns 'The requested URL /undefined was not found on this server.', while text links and standard form buttons work just fine. This is part of a collaborative project for school, and we need it to have a snazzy interface and the image links are a massive part of that.
Here is the simple js I've got to handle the links:
$( document ).on(
"click",
"a",
function( event ){
event.preventDefault();
location.href = $( event.target ).attr( "href" );
}
);
The button HTML looks like this:
<div id="loginBtn"><a href="memberLogin.php"><img src="CSS images/0-btn1.png" width="224" height="113" /></a></div>
Any suggestions would be much appreciated.