编程语言

img blueyuren

QueryString in Javascript

发表于2004/11/1 13:53:00  737人阅读

///Page.QueryString[]
<script language=javascript>
function QueryString(fieldName)
 {  
      var urlString = document.location.search;
      if(urlString != null)
      {
           var typeQu = fieldName+"=";
           var urlEnd = urlString.indexOf(typeQu);
           if(urlEnd != -1)
           {
                var paramsUrl = urlString.substring(urlEnd+typeQu.length);
                var isEnd =  paramsUrl.indexOf('&');
                if(isEnd != -1)
                {
                     return paramsUrl.substring(0, isEnd);
                }
                else
                {
                    return paramsUrl;
                }
           }
           else 
           return null;
      }
     else
     return null;
 }
</script>
阅读全文
0 0

相关文章推荐

img
取 消
img