[导入]JavaScript常用函数:Request()

//功能:实现ASP的取得URL字符串,Request("ID")
//来源:http://jorkin.reallydo.com/article.asp?id=464
//实例:alert(Request["ID"])

var passurl = location.search;
var str = "";
if (document.URL.split("?")[1] != undefined)
{
  
str = document.URL.split("?")[1].replace(/\#/g, "");
}

var Request = new Object();
if (passurl.indexOf("?") !=  - 1)
{
  
strs = str.split("&");
  
for (var i = 0; i < strs.length; i++)
  {
    
Request[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
  }
}


文章来源:http://Jorkin.Reallydo.Com/default.asp?id=464
posted @ 2008-02-22 15:08  pboy2925  阅读(170)  评论(0编辑  收藏  举报