奇怪的是代碼工作,並且在某一行下面什麼都不會工作,甚至沒有警報,變量也失去了值!javascript停止工作只能在代碼中的某一行下方
的代碼非常簡單:
// retrieving scroll position from a hidden text input<br>
var scrollPos = document.getElementById("scrollPosition").value;
// at this point scrollPos value is a certain number :)
// so i'm successfully able to change the HREF accordingly! :)<br>
document.getElementById("page1").href = "page1.php?pos="+scrollPos;<br>
document.getElementById("page2").href = "page2.php?pos="+scrollPos;<br>
document.getElementById("page3").href = "page3.php?pos="+scrollPos; // same value to all!
document.getElementById("page4").href = "page4.php?pos="+scrollPos;<br>
// at some weird point scrollPos loses its value! :(
其實,沒有什麼毛刺點的作品,甚至不是一個警報(「測試」)後!
嗨米莫,你有這個工作嗎? – Sergio 2013-08-05 07:06:37