Abhinav Gujjar
Abhinav Gujjar

Reputation: 2620

JSONP on Mobile browsers

Has anyone used JSONP style of programming on mobile browsers ? Were there any limitations as compared to desktop.

I realize that fundamentally JSONP is nothing more than a JSON padded with a callback function to get around the cross domain issue.

What I'm more interested in is how the browser handles dynamic injection of DOM elements via this technique. Does it work?

We are looking to build out a widget based framework that needs to run across desktop and mobile environments.

EDIT : I found these 2 links that suggest that it indeed does work. Would still be interested in detailed experiences or gaps seen by the community

JSONP calls not working with apple-mobile-web-app-capable="yes"

JSONP not firing on IPad

Upvotes: 1

Views: 651

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599111

In general JSONP works equally well across desktop and mobile devices. Since it just depends on the browser being able to load a script file from a server on a different domain, it has a pretty low entry-level for browser vendors to not support it. E.g. if JSONP doesn't work, scripts loaded from CDNs will fail just as well.

Inserting DOM elements from JavaScript is similarly well supported across modern browsers.

If you are worried about specific browsers/devices not supporting either of these features, I suggest you update your question with details about those.

Upvotes: 1

Related Questions