I am making an ajax call to check username availability. The url to call is hardcoded in the js file. e.g http://abc.com/users/check_availability.
Now when i make the ajax call from http://abc.com it works fine, however if i make the call from http://www.abc.com, it gives a cross domain error.
XMLHttpRequest cannot load http://abc.com/users/check_availability?username=sd. Origin http://www.abc.com is not allowed by Access-Control-Allow-Origin.
How do i resolve this ? Is jsonp the only way ?
www.abc.comtoabc.com. You can do this with mod_rewrite if you're using Apache.