[help]jQuery.ajax() problem

Joined
Feb 10, 2011
Messages
413
Reaction score
99
I am trying to make a post to a webpage. The post goes well and there comes a 302 responds. Then the page should redirect but that gets cancelled according to the google console and the call stops. I need it to redirect because I need the info of that page.
Langstra - [help]jQuery.ajax() problem - RaGEZONE Forums

The code I am using is this one:
Code:
var url = "http://eetlijst.nl/login.php";
var params = {login: "username", pass: "password"};
var responds;
responds = jQuery.ajax({
	type: "POST", 
	url: url, 
	data: params,
	crossDomain: true,
	complete: function(jqXHR, textStatus) {
    	      console.log(jqXHR.getAllResponseHeaders());
  	}
});
Anybody an idea how to solve this, I have tried for several hours now but I cannot find the solution.
 
I think the problem is on the browser security side. There's a "same name" rule that states your requests from /C:/xampp/htdocs/etc don't match the redirected domain.

You should make HTTP requests in JavaScript to files on your server using the same domain. You shouldn't do so to any other server/domain. By the way, this rule includes sub-domains- www. foo.com is not the same as foo.com. You can use a certain HTTP header to inform the browser that an other domain should be allowed access, but it's usually not necessary.
 
Back