如果使用比較運算子:「==」、「!=」、「===」、「!==」,需要先使用「date.getTime()」,
例如:
var d1 = new Date();
var d2 = new Date(d1);
var same = d1.getTime() === d2.getTime();
var notSame = d1.getTime() !== d2.getTime();
Robert 發表在 痞客邦 留言(0) 人氣(425)
如果我已經取得form元素,要如何取得底下的tag呢?
var x = document.getElementById("myForm").elements.length;
Robert 發表在 痞客邦 留言(0) 人氣(296)
javascript學習之BOM come from 冬風網+瓢城俱樂部,特此感謝
HTML a href 連結屬性
Robert 發表在 痞客邦 留言(0) 人氣(13)
eval("your script here");
Robert 發表在 痞客邦 留言(0) 人氣(72)
目前我用的是,frameset 的 onload:
<frameset onload="OnFramesetLoad()">
Robert 發表在 痞客邦 留言(0) 人氣(56)
原來,要取得frame裡,頁面的元素,還要多一層寫法:
var ele = window.frames['frame_name'].document.getElementById('element_id');
Robert 發表在 痞客邦 留言(0) 人氣(482)
總結:
<a href="javascript: handler(); return false;">連結</a>
Robert 發表在 痞客邦 留言(0) 人氣(1,167)
Robert 發表在 痞客邦 留言(0) 人氣(4,388)
1. 不能寫成 return(false);
2. 在 form tag 要加「return」。
Robert 發表在 痞客邦 留言(0) 人氣(585)
form 表單,在送出前的事件。
window.onbeforeunload = confirmExit;
function confirmExit()
{
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Save button, your changes will be lost. Are you sure you want to exit this page?";
}
Robert 發表在 痞客邦 留言(0) 人氣(168)