I have an ajax call like this:
$.ajax({
type: "POST",
url: "www.something.com/login.php",
cache:false,
dataType: "json",
data: {
username: $('#user').val(),
password: $('#pass').val()
},
success: function(response)
{
localStorage.setItem('user',response.results[0].user);
localStorage.setItem('company',response.results[0].company);
}
});
This is not working because I'm trying to connect to the script which is not on the same root as my files, this PHP file is located on the external server.
How do I need to use JSONP
to get this script working?