I am developing an app for the iphone.The thing is that i want to send the values of longitude and latitude i get from the phone using javascript to a server commanding it to search for something.Do i have to read about cross domain stuff?How could this be done?
I know that i can use Ajax but it can serve me if i refer to the same domain.
For example how can i do this:
$.post('http://127.0.0.1:8000/search/',{lon:30}) and have my database searched for objects that have this longitude?
I don't want to do this:
$.post('/search/',{lon:30})
I use django on the server side.
views:
112answers:
3
A:
There is something called JSONP that is meant to solve this problem. You can read about it here. Its basically regular json with a callback function.
Jason Christa
2009-10-11 23:13:46
A:
JSONP or "serverside AJAX proxy" are your two options if the target server is in a different domain than your application.
Andrew Kolesnikov
2010-02-23 03:13:59