Computing Magazine

Ajax Call Forces Redirect from HTTPS to HTTP Return 302

Posted on the 23 April 2012 by Akahgy

Description:

Calling an Ajax request from a HTTPS server redirects to the HTTP server causing a 302 redirect return message if the HTTP and HTTPS servers are on different IPs.

Solution:

Ajax calls through JavaScript will always redirect to HTTP. To remain on the first server, or to return the 200 status regarding of the server, we have to use jQuery Ajax calls.

Also the call is much more simpler, faster and precise:

$(“#load_get”).click(function(){
$(“#result”)
.html(ajax_load)
.load(loadUrl, “getvalues.php=php&id=5″);
});


Back to Featured Articles on Logo Paperblog

Magazine