javascript 页面传值

 

  <script type="text/javascript">
                  
function EnterSearch(event) {
                      
if (event.keyCode == 13) {
                          SearchGoogle();
                      }
                  }

                 
                  
           
                  
function SearchGoogle() {
                      
var keystr = encodeURIComponent(document.getElementById('searchKeyword').value);
                      window.location 
= "/search.aspx?keyword=" + keystr;
                  }
              
</script>




  
var urlString = document.location.search;
    
if (urlString != null) {
        
var keyword = QueryString("keyword");
       
// alert(keyword);
        if (keyword != null && keyword != '') {
            document.getElementById(
'sbi').value = decodeURIComponent(keyword);
            document.getElementById(
'form1').submit();
        }
    }
原文地址:https://www.cnblogs.com/duwamish/p/1407001.html