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

Javascript DOM»ù´¡

DOMÊÇÕë¶ÔXMLµÄ»ùÓÚÊ÷µÄAPI£¬ËüÓëÓïÑÔÎ޹أ¬ÊµÏÖ·½Ê½ÓкܶàÖÖ£¨¸÷ÓïÑÔ»ù±¾¶¼ÓÐ×Ô¼ºµÄʵÏÖ£©¡£
²»¹ýÎÒÃǾ­³£Óõģ¬ÊÇJavaScript ϵÄdomÕë¶ÔxhtmlµÄ²Ù×÷£¬Ö»ÊÇdomµÄÒ»¸ö·ÖÖ§Ó¦Óá£
Ãû´Ê½âÊÍ£º
Dom£ºÎĵµ¶ÔÏóÄ£ÐÍ¡£Document object model
Bom£ºä¯ÀÀÆ÷¶ÔÏóÄ£ÐÍ£¬Ò²¿ÉÒԽд°¿Ú¶ÔÏóÄ£ÐÍ¡££¨window object model.£©
API£ºÓ¦Óñà³Ì½Ó¿Ú¡£DOMÆäʵ¿ÉÒÔ¿´×÷Ò»ÖÖAPI¡£
Node£º½Úµã¡£½Úµã·ÖΪ£ºÔªËؽڵ㣬ÊôÐԽڵ㣬Îı¾½Úµã¡£ÔªËؽڵã°üº¬ÊôÐÔ½ÚµãºÍÎı¾½Úµã¡£
DOMÊ÷½á¹¹£º
Document - ×²ã½Úµã£¬ÆäËû½Úµã¸½ÊôÓÚËü
DocumentType - DTD ÒýÓýڵã
DocumentFragment - ¿ÉÒÔÏñ Document Ò»Ñù±£´æÆäËû½Úµã
Element - ±íʾÆðʼ±êÇ©ºÍ½áÊø±êÇ©Ö®¼äµÄÄÚÈÝ
Attr - ±íʾÊôÐÔÃûºÍ value
Text - ±íʾ±êÇ©Ö®¼äµÄÎı¾£¬»òÕß CDATA section °üº¬µÄÎı¾
CDataSection -  ½Úµã
Entity - Entity ¶¨Òå½Úµã£¬<!ENTITY foo "foo">
EntityReference - ʵÌåÒýÓýڵã
ProcessingInstruction - PI ½Úµã
Comment - ×¢Êͽڵã
Notation - ±íʾ DTD Öж¨ÒåµÄ¼ÇºÅ
½Úµã³£Á¿Öµ
ELEMENT_NODE---------------------------1
ATTRIBUTE_NODE-------------------------2
TEXT_NODE---------------------------------3
CDATA_SECTION_NODE------------------4
ENTITY_REFERENCE_NODE--------------5
ENTITY_NODE------------------------------6
PROCESSING_INSTRCTION_NODE-----7
COMMENT_NODE--------------------------8
DOCUMENT_NODE------------------------9
DOCUMENT_TYPE_NODE ---------------10
DOCUMENT_FRAGMENT_NODE---------11
NOTATION_NODE-------------------------12
ÑÝʾ´úÂ룺
<style type="text/css">
body{background-color:#EEEEEE; font-size:12px;line-height:22px;}
span{border:#333333 1px dashed; padding:2px;}
</style>
<script language="javascript" type="text/javascript">
function nodetype(){
var a=document.createElement("div");
var c=document.createElement("span");
var b=document.createTextNode("this is text");
c.appendChild(b); //Îı¾Ìí¼Óµ½ÔªËؽڵã
a.appendChild(c);  //span½ÚµãÌí¼Óµ½div½Úµã
document.body.appendChild(a);
var newc=a.cloneNode(true);  //true£ºÈ«²¿¸´ÖÆ£¬°üÀ¨×Ó½Úµã
document.body.appendChild(newc);
v


Ïà¹ØÎĵµ£º

JavaScript´¦ÀíJson

JSON(JavaScript Object Notation) ÊÇÒ»ÖÖÇáÁ¿¼¶µÄÊý¾Ý½»»»¸ñʽ£¬Ò×ÓÚÔĶÁºÍ±àд£¬Í¬Ê±Ò²Ò×ÓÚ»úÆ÷½âÎöºÍÉú³É¡£Ëü»ùÓÚECMA262ÓïÑԹ淶£¨1999-12µÚÈý°æ£©ÖÐJavaScript±à³ÌÓïÑÔµÄÒ»¸ö×Ó¼¯¡£ JSON²ÉÓÃÓë±à³ÌÓïÑÔÎ޹صÄÎı¾¸ñʽ£¬µ«ÊÇҲʹÓÃÁËÀàCÓïÑÔ£¨°üÀ¨C£¬ C++£¬ C#£¬ Java£¬ JavaScript£¬ Perl£¬ PythonµÈ£©µÄÏ°¹ß£¬ÕâЩÌØÐ ......

´«ÖDz¥¿ÍJavaѧϰ JavaScript¼ÓÇ¿

ÎÒ½ñÌìѧϰÁËÙ¡ÀÏʦ½²µÄJavaScript½âÎöDomÎĵµµÄ֪ʶ£º
Ò»¡¢        ½Úµã·ÖΪ3ÖÖÀàÐÍ£¬ÔªËؽڵ㣬ÊôÐԽڵ㣬Îı¾½Úµã
¶þ¡¢        ²éÕҽڵ㣺
l       js´úÂë²»ÄÜдÔÚbodyÔªËصÄÇ°Ã棬js ´úÂëдÔÚ <head> ½ ......

JavaScript HashTable

/**
* ×Ô¼ºµÄ HashTable
* Ô¸½Å±¾ÉñÁ¦ÓëÄãͬÔÚ
*/
function HashTable(){
var values = {};

/** ½«Öµ²åÈë HashTable ÖÐ **/
this.put = function(key, value){
if(key in values){
return false;
}
values[key] = value;
}
/** ¸ù¾Ý key ·µ»Ø value **/
this.find = function(key){
ret ......

£¨Ñ§Ï°±Ê¼Ç£©JavaScriptÖе÷Óú¯ÊýµÄÀ¨ºÅÎÊÌâ

 ÎÒÔÚjsÖж¨ÒåÁËÒ»¸öº¯Êý£º
 function closeCodeList()
{
try
{
showFistIndex = 0;
arrayBmCode = null;
if(document.all("spanCode").style.display=='')
{
var disFlag=1;
}
document.all("spanCode").style.display='none';
try{if(disFlag)oldFieldKey.focus();}catch(ex){}
}
c ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ