Quantcast
Channel: Cross Domain URL - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by GreymondTheLong for Cross Domain URL

$
0
0

Just add the data to the URL section of your ajax call.

$.ajax({    url: 'http://api.addressify.com.au/address/autoComplete?api_key=99acd24a-1c94-49ad-b5ef-6f90d0f126b1&term=1+George+st+t&state=nsw&max_results=5',    type: 'GET',    crossDomain: true, // enable this    success: function () { alert('PUT completed'); }});

If you can't hard code some of this data you can turn the url declaration into a function.

url: function() {     return "http://api.addressify.com.au/address/autoComplete?api_key=" this.get("api_key") +"&term="+ this.get("term") +"&state="+ this.get("state") +"&max_results="+ this.get("max_results") }}

I'm using the backbone model methods for getting the data - use whatever you need to do.


Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>