복붙노트

[JQUERY] 어떻게 GET GET와 jQuery로 POST 변수에?

JQUERY

어떻게 GET GET와 jQuery로 POST 변수에?

해결법


  1. 1.GET 매개 변수의 경우, document.location.search에서 그들을 잡아 수 있습니다 :

    GET 매개 변수의 경우, document.location.search에서 그들을 잡아 수 있습니다 :

    var $_GET = {};
    
    document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
        function decode(s) {
            return decodeURIComponent(s.split("+").join(" "));
        }
    
        $_GET[decode(arguments[1])] = decode(arguments[2]);
    });
    
    document.write($_GET["test"]);
    

    POST 매개 변수의 경우, 당신은