Using Ajax in Your Ion Experiences

Ion Ajax Proxy

Ion's Ajax proxy allows cross-domain (and cross-subdomain) Ajax requests within ion creatives. To use it, simply make a GET request to the proxy and pass a URL-encoded parameter "u". The value of "u" is your URL along with any associated query string data. The proxy then returns the URL's response back.

Implementation Example

Ion Proxy URL: 

/Javascript/Proxy.aspx

Sample web service / Ajax call:

http://www.yourdomain.com/json/hints?query=dogs

Call to the proxy with this sample URL:

/Javascript/Proxy.aspx?u=http%3A%2F%2Fwww.yourdomain.com%2Fjson%2Fhints%3Fquery%3Ddogs

And Proxy.aspx will return the response from http://www.yourdomain.com/json/hints?query=dogs.

*Note that the value of "u" must be URL-encoded -- eg: encodeURIComponent("http://www.yourdomain.com/json/hints?query=dogs")