Where The Streets Have No Name

get변수 받기 본문

Developement/Web

get변수 받기

highheat 2006. 6. 27. 14:39
<Script Language=JavaScript>
function parseURL(str){
  var param;
  str = new String(str);
  arr = str.split("?");
  if(arr[1]){
      param = arr[1].split("&");
      for(var x in param){
          p = param[x].split("=");
          HTTP_GET_VARS[p[0]] = p[1];
      }
  }
}
var HTTP_GET_VARS = new Array();
parseURL(document.location);
for(var x in HTTP_GET_VARS) document.writeln(x+'='+HTTP_GET_VARS[x]+'<br>');
</script>