JSONP on Safari / iPhone and Opera / Android does not work

I am trying to make a JSONP request that works in all desktop browsers, but it does not work on iPhone and Android.

Im makes a cross-domain call to a web service that returns JSONP, for example:

myFunction({name : "Jonh", last : "Doe"})

        $.ajax({
                type: "GET",
                crossDomain: true,
                url: "http://192.168.1.41:8081/Service1/",
                dataType: "jsonp",
                processData : true,
                headers: {
                    "Content-Type": "application/json"
                },
                jsonp : "myFunction",
                jsonpCallback: "myFunction"
                });

    function myFunction(data)
    {
        alert("Hello world!");
    }

It WORKS on DESKTOP, but not on mobile!

Any idea?

+3
source share
1 answer

My problem was that I am sending a JSONP request from the http server (my dev computer) to the https server.

to be fully understood, it looks like this:

request http://localhost.com at https://api.xxx.com

It works in all browsers except mobile safari.

http → http = work
https → https = work
http → https =

0

All Articles