javascript 로 GET 추출하기? javascript parse get
How to extract GET variable with javascript?
PHP 같은 웹 어플리케이션 프로그램을 사용하지 않고도 GET 변수를 추출할 수 있다.
var $_GET = {};
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
function decode(s) {
return decodeURIComponent(s.split("+").join(" "));
}
$_GET[decode(arguments[1])] = decode(arguments[2]);
});
사용방법
alert($_GET["boardID"]);