JavaScriptÏÔʾµ±Ç°Ê±¼ä
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ϵͳʱ¼äµÄÏÔʾ</title>
<script type="text/javascript">
function getDate() {
window.setInterval("setDate()", 1000); //Ñ»·µ÷ÓÃ
}
function setDate() {
var date = new Date();
document.getElementById('time').value = date.toLocaleTimeString();
}
</script>
</head>
<body onload="return getDate();">
ÏÖÔÚʱ¼äÊÇ£º<input type="text" name="time" value="" />
</body>
Ïà¹ØÎĵµ£º
scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......
"#"°üº¬ÁËÒ»¸öλÖÃÐÅÏ¢
ĬÈϵÄêµãÊÇ#top Ò²¾ÍÊÇÍøÒ³µÄÉ϶Ë
¶øjavascript:void(0) ½ö½ö±íʾһ¸öËÀÁ´½Ó
Õâ¾ÍÊÇΪʲôÓеÄʱºòÒ³ÃæºÜ³¤ä¯ÀÀÁ´½ÓÃ÷Ã÷ÊÇ#¿ÉÊÇÌø¶¯µ½ÁËÒ³Ê×£¬¶øjavascript:void(0) Ôò²»ÊÇÈç´Ë
ËùÒÔµ÷Óýű¾µÄʱºò×îºÃÓÃvoid(0)
»òÕß<input onclick>
<div onclick>µÈ
´ò¿ªÐ´°¿ÚÁ´½ÓµÄ¼¸ÖÖ°ì·¨ ......
ÌáÆðÃæÏò¶ÔÏóÎÒÃǾÍÄÜÏëµ½À࣬¶ÔÏ󣬷â×°£¬¼Ì³Ð£¬¶à̬¡£ÔÚ¡¶javaScript¸ß¼¶³ÌÐòÉè¼Æ¡·£¨ÈËÃñÓʵç³ö°æÉ磬²ÜÁ¦¡¢ÕÅÐÀÒë¡£Ó¢ÎÄÃû×ÖÊÇ£ºProfessional JavaScript for Web Developers£©Õâ±¾ÊéÖÐÃèÊöµÄ»¹Ëã±È½ÏÏêϸ¡£ÎÒÃÇ¿´¿´JavaScriptÖж¨ÒåÀàµÄ¸÷ÖÖ·½·¨¡£
1£®¹¤³§·½Ê½
javaScri ......
×Ô¼ºÒÔǰд¹ýһƪÎÄÕ£¬ÊǹØÓÚdomÏÂxpathµÄ±àд£¬²»¹ýÄÇÊǽèÖúä¯ÀÀÆ÷±¾ÉíµÄÌØÐÔ£¬Õâ´ÎÎÒÏëÓÃjavascripºÍÕýÔò±í´ïʽ´òÔì×Ô¼ºµÄxpath£¬²»¶à啰࣬¿´´úÂ룺
function xpath(n,m){
if(/\]$/i.test(m)){
var t1=[]
var reg=/ ......
ÀûÓÃjsÀ´¶¯Ì¬´´½¨±í¸ñÓÐÁ½ÖÖ¸ñʽ£¬appendChild()ºÍinsertRow¡¢insertCell()¡£Á½ÖÖ·½Ê½Æäʵ²î²»¶à£¬µ«µÚÒ»ÖÖÓпÉÄÜÔÚIEÉÏÓÐÎÊÌ⣬ËùÒÔÍƼö´ó¼ÒʹÓõڶþÖÖÁË£¬Ö±½Ó˵°É¡£
1¡¢inserRow()ºÍinsertCell()º¯Êý
insertRow()º¯Êý¿ÉÒÔ´ø²ÎÊý£¬ÐÎʽÈçÏ£º
insertRow(index)£ºindex´Ó0¿ªÊ¼
Õâ¸öº¯Êý½«ÐÂÐÐÌí¼Óµ½indexµÄÄÇÒ»ÐÐÇ ......