2008-11-17 81 views

回答

1

如果您從一個頁面重定向到另一個頁面,您必須使用表單元素在頁面間傳遞或使用querystring值。這就是它,JavaScript沒有以前的頁面結構的任何知識..

1

,或者您可以使用Cookie ...

0

你也可以簡單地通過調用site.com/index.php?info=value和逃避的內容使用GET變量value。網址可以按照如下方式進行更改:

<input type="text" id="the_value" /> 
<a href="#" onclick="return updateURL()" id="the_link">Click me</a> 
<script type="text/javascript"> 
function updateURL() 
{ 
    document.getElementById('the_link').href = 
     'site.com/index2.php?info=' + 
     encodeURIComponent(document.getElementById('the_value')); 
    return true; 
} 
</script> 
相關問題