function displayjob1(ref,position)
{
document.getElementById("jobref").value=ref;
document.getElementById("jobp").value=position;
}
function store()
{
var jobref1=100011;
var jobposition1="Application Engineer";
displayjob1(jobref1,jobposition1);
}
function link()
{
window.location.href='enquire.html';
store();
}
function job() {
click1=document.getElementById("job1");
click1.onclick=link;
}
window.onload=job;
不工作時,頁面加載和我點擊了一個按鈕,鏈接,它關係到enquire.html
,但隨後另一個頁面加載後的文本有沒有價值store()
和display()
將無法正常工作。功能在javascript
可能重複執行重定向後的函數 - javascript](http://stackoverflow.com/questions/9524606/execute-a-function-after-redirecting-javascript) – JJJ
隨着每一頁加載,html刷新。如果你希望它們「存活」頁面重載,你可以在cookie中存儲變量 –