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 cannot copy 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 use the basic model methods to get the data - use everything you need.
Greymondthelong
source share