Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JavaScriptÌ°³ÔÉß

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>̰ʳÉß</title></head>
<body>
<mce:style type="text/css"><!--
.table_back{width:320px;height:320px;border-bottom:1px solid black;border-right:1px solid black;}
.floor{border-left:1px solid black;border-top:1px solid black;font-size:1px;}
--></mce:style><style type="text/css" mce_bogus="1">.table_back{width:320px;height:320px;border-bottom:1px solid black;border-right:1px solid black;}
.floor{border-left:1px solid black;border-top:1px solid black;font-size:1px;}</style>
<mce:script type="text/javascript"><!--
/*--
±êÌ⣺¼òµ¥µÄÌ°³ÔÉß
Éè¼Æ£ºÍõ¼¯ðÀ
²©¿Í£ºhttp://blog.csdn.net/zswang
ÈÕÆÚ£º2010Äê1ÔÂ22ÈÕ
--*/
function Snake(options) {
var self = this;
options = options || {};
this.colCount = options.colCount || 20;
this.rowCount = options.rowCount || 20;
this.parent = options.parent || document.body; // ÈÝÆ÷
this.speed = options.speed || 200; // Òƶ¯¼ä¸ôʱ¼ä
this.initLength = options.initLength || 3; // ³õʼ³¤¶È

this.button_replay = document.createElement("input");
this.button_replay.type = "button";
this.button_replay.value = "replay";
this.button_replay.onclick = function() {
self.replay();
};
this.parent.appendChild(this.button_replay);
this.table_back = document.createElement("table");
this.table_back.className = "table_back";
this.table_back.cellPadding = "0px";
this.table_back.cellSpacing = "0px";
this.playing = false; // ÊÇ·ñÔÚ½øÐÐÖÐ
this.floors = {}; // ¾ØÕóµØ°å¾ØÕó [y,x]
for (var i = 0; i < this.rowCount; i++) {
var tr = this.table_back.insertRow(-1);
for (var j = 0; j < this.colCount; j++) {
var td = tr.insertCell(-1);
td.classNa


Ïà¹ØÎĵµ£º

javascript½«×Ö·û´®ÀàÐÍת»»ÎªXML¶ÔÏó

try { //Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(data);
} catch(e) { //Other Browsers
parser=new DOMParser();
xmlDoc=parser.parsefromString(data,"text/xml");
} ......

Javascript DOM»ù´¡

DOMÊÇÕë¶ÔXMLµÄ»ùÓÚÊ÷µÄAPI£¬ËüÓëÓïÑÔÎ޹أ¬ÊµÏÖ·½Ê½ÓкܶàÖÖ£¨¸÷ÓïÑÔ»ù±¾¶¼ÓÐ×Ô¼ºµÄʵÏÖ£©¡£
²»¹ýÎÒÃǾ­³£Óõģ¬ÊÇJavaScript ϵÄdomÕë¶ÔxhtmlµÄ²Ù×÷£¬Ö»ÊÇdomµÄÒ»¸ö·ÖÖ§Ó¦Óá£
Ãû´Ê½âÊÍ£º
Dom£ºÎĵµ¶ÔÏóÄ£ÐÍ¡£Document object model
Bom£ºä¯ÀÀÆ÷¶ÔÏóÄ£ÐÍ£¬Ò²¿ÉÒԽд°¿Ú¶ÔÏóÄ£ÐÍ¡££¨window object model.£©
API£ºÓ ......

JavaScriptÈ¡µÃselect option value

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<mce:style type="text/css"><!--

div#show { float: right; color: blue; }

--></mce:style><style type="text/css" mce_bogus=" ......

href=¡°#¡±Óëhref=¡°javascript:void(0)¡±Çø±ð

ʹÓùýajaxµÄ¶¼³£¼ûÕâÑùµÄ´úÂ룺
<a href="javascript:doTest2();void(0);" mce_href="javascript:doTest2();void(0);">here</a>
µ«Õâ¶ùµÄvoid(0)¾¿¾¹ÊǺκ¬ÒåÄØ£¿
JavascriptÖÐvoidÊÇÒ»¸ö²Ù×÷·û£¬¸Ã²Ù×÷·ûÖ¸¶¨Òª¼ÆËãÒ»¸ö±í´ïʽµ«ÊDz»·µ»ØÖµ¡£
void ²Ù×÷·ûÓ÷¨¸ñʽÈçÏ£º
1. javascript:void (expres ......

ie6ÖÐhrefÉèΪjavascript:void(0)Ò³ÃæÎÞ·¨Ìá½»

<a class="bt_3" href="javascript:void(0)" mce_href="javascript:void(0)" id="btnSubmit1" onclick="submitPage()">Ìá½»</a>
submitPage() ÊÇÎÒ¶¨ÒåµÄÒ»¸öº¯Êý£¬Ô­ÒâÊǵã»÷Õâ¸ö<a>ʱ£¬Ìá½»Ò»¸ö±íµ¥¡£ft, ie6 ¾ÓÈ»²»¿ÉÒÔ£¬ÔõôҲ²»ÄÜÌá½»¡£
¿´À´ÊÇÒòΪ ie6 Ö´ÐÐĬÈ϶¯×÷ÒýÆðÀ´£¬Ä¿Ç°Á½ÖÖ½â¾ö·½·¨£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ