JSONP does not work with apple-mobile-web-app-able = "yes"

Problem: With the installation, <meta name="apple-mobile-web-app-capable" content="yes" />all my jsonp requests are denied. I read that by setting content = "yes" you cannot change the page. But I did not know that you cannot request external resources. And this application has to be full screen. Is there a way to use this tag to set up iPad in full screen mode on an html5 app?

Currently, my requests are simply sent to another subdomain, and they are all denied? Does anyone have an idea how to get around this? Allow jsonp and force fullscreen?

+2
source share
2 answers

So, the solution to this was complicated.

JSONP, . , <meta name="apple-mobile-web-app-capable" content="yes" />, , Access-Control-Allow-Origin .

, :

. & jsoncallback =?

:

function jsonpRequest(req){
    $.getJSON(req,
      function(data) {
        // JSONP will run getJson() above;
    });
}

:

function jsonpRequest(req){
        $.ajax({
          url: req,
          dataType: 'json',
         beforeSend: setHeader,
          //data: data
          //success: callback
        });
        /*
        $.getJSON(req,
              function(data) {
                // JSONP will run getJson() above;
            });*/

    }
    function setHeader(xhr) {

     xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
    } 
+4

, , "callback =?" ?

dataType : http://api.jquery.com/jQuery.ajax/

0

All Articles