How to get the return result of 303 status for xhr or jQuery ajax, Post request

problem website
http://www.xingk.cc/forum.php.
needs to be registered, which is quite troublesome. Here is a temporary account
account: Av123456!

password for Alain Lei who likes to play with shit.

problem description
the address of the network disk of the forum is added with a jump chain and is randomly generated. The jump chain is redirected to the network disk using 303.

demand result
is there a way to get the redirect result of the 303 state returned by this jump chain?
jQuery"s success seems to be executed only if the stats is 200.
xhr neither onreadystatechange nor error nor onload, gets the result of redirection.

Test Code
jQuery

    var jq=document.createElement("script");
    jq.src="http://cdn.staticfile.org/jquery/2.1.4/jquery.min.js";
    document.body.appendChild(jq);
    
    function getQueryString(name,url) {
      url=(url&&url.match(/\?.*/).toString())||location.search;
        var reg = new RegExp("(?:^|&)(" + name + ")=([^&]*)(?:&|$)", "i");
        var str = url.substr(1).match(reg);
        if (str != null) return unescape(str[2]);
        return null;
    }
    
$("a[href*="linkFilter.php"]").each(function(){
$.ajax({
url:"linkFilter.php",
type:"post",
traditional:true,
data:this.href.replace(/.+\?(.+)/,"$1")+"&mod=decode",
contentType:"application/x-www-form-urlencoded",
processData: false,
success:function(e,s,t,d){
console.log(s,t,e);
},
})
})

xhr



native XMLHttpRequest can be determined by request.readyState and request.status .


since you can't find what you want in success, why not try fail or complete


The

XMLHttpRequest.responseURL property returns the final URL after any number of redirects.

https://developer.mozilla.org.

there must be that CORS error, and you can ignore it. But I guess you want to make a script for your own use? The browser plug-in will give you cross-domain xhr, but I recommend lightweight oil monkey scripts.

Menu