O'Reilly logo

iPhone JavaScript Cookbook by Arturo Fernandez Montoro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending cross-domain requests

The previous recipes in this chapter show you how to make HTTP requests and how to process responses in JSON format. But our examples assume that we're using a request from and to the same domain. At the moment, we only use localhost as our domain but it can be replaced by your public domain name. Keep in mind that it could be really useful to make requests to other domains. For example, let's suppose that we need to get some data from a domain other than the one where our application is running. Handling this situation requires a specific technique, which is different from a regular HTTP request. In order to help, the WebApp.Net offers us a specific object plus a PHP script. Actually, this recipe will show you how ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required