I've created a web-app for full screen on the ipad. Just to clarify, everything works fine from the computer, everything works fine from the browser on ipad, its only when its full screen as web-app that it is having issues.
The code is simple
$.ajax({
type :'POST',
cache :false,
data :{'t':8,
'qt':10,
'x':'Yup'},
url :'/rep/ajaxcall',
success:function(response){
alert("i'm here");
},
complete:function(){
alert("i'm not here");
},
error:function(){
alert('opps');
},
});
controller action
public function ajaxcall(){
echo "it worked";
}
so the code never executes inside the success, error or complete. if I try $.ajax(...).done() and put an alert in the done section, that will also not fire.
there is only one way I've found that will make this code work. I must but an alert('something') after the ajax call. then it works every time. I've read all the different questions on here, forums, apple, and everywhere else that I could find and tried all of the solutions that others have tried for problems similar. I have not found this exact problem else where.
i tried putting a delay after the ajax call to see if the alert was delaying processing long enough for the ajax to fire, but that had no affect.
** UPDATE **
I put a mail function in the ajax function on the server, and it does not receive the call unless the alert is in the javascript.
this is header tag for full screen
<meta name="apple-mobile-web-app-capable" content="yes" />
I've faced a similar problem and fixed it setting an absolute path from document root folder to the script processing the ajax call. In my case the file containing the ajax call is being included from a file located in a different folder, if POST variable is set. And the ajax processing file is located in another different folder. In your case it must be:
url: 'absolute/path/to/rep/ajaxcall'