Javascript DOMѧϰ±Ê¼Ç2
´´½¨ÎĵµÔªËØ
document.createElement(nodename)
²åÈëÔªËص½Îĵµ½ÚµãÊ÷
parent.appendChild(child)
´´½¨Îı¾½Úµã
document.createTextNode(text)
ÔÚÏÖÓÐÔªËØÇ°²åÈëÐÂÔªËØ
parentElement.insertBefore(newElement,targetElement)
ÔÚÏÖÓÐÔªËغó²åÈëÐÂÔªËØ£¨×ԱຯÊý£©
parentElement.insertAfter(newElement,targetElement)
parentElement.insertAfter(newElement,targetElement)
function insertAfter(newElement,targetElement)
{
var parent = targetElement.parentNode;
if (parent.lastChild == targetElement)
{
parent.appendChild(newElement);
}
else
{
parent.insertBefore(newElement,targetElement.nextSibling);
}
}
Ïà¹ØÎĵµ£º
ÓÐʱºò½øÐÐajax½»»¥µÄʱºò£¬·µ»ØµÄÊý¾Ý¿ÉÒÔ×Ô¼ºÌí¼Ó·Ö¸ô·û£¬±ÈÈç^^^£¬È»ºó¶ÔÕâЩ·Ö¸ô·û½øÐнâÎö£¬·Ö½âΪһ¸öÊý×é¡£
function fill(v) {
if (v == undefined)return false;
var result = v.split("^^^");
$("#cnPatent").val(result[0]);
$("#cnPText").val(result[1]); ......
Õâ¸öЧ¹ûÓ¦¸Ã²»ËãʲôϡÆ棬ÍøÉÏÒ²ÓÐÏֳɵĴúÂ룬ÎÒÕâ¸öҲûʲôÌرðµÄµØ·½£¬Ö»ÊÇÒòΪÎÒ×Ô¼ºÐ´µÄ£¬Ò²ËãÊÇΪѧϰDOMºóÒ»¸öÁ·Ï°£»ÔÚIEϲâÊÔͨ¹ý£»
ʵÏÖЧ¹ûÊÇÕâÑùµÄ£º
¶ÁÈ¡XMLÎĵµ£»
²ÉÓõݹéÉú³ÉÎÞÏÞ¼¶µÄÊ÷Ðβ˵¥£»
Äܹ»ÏìÓ¦Êó±êʼþ£¬Õ¹¿ªÓë²ðµþ×Ó¼¶²Ëµ¥£»
Ê×ÏÈÊÇÉú³ÉÒ»¸öXMLÎĵµ£¬ÎÒÓõÄÊÇXML SpyµÄ±à¼Æ÷£»
< ......
Ò»¡¢deleteÔËËã·ûɾ³ý¶ÔÒÔÇ°¶¨ÒåµÄ¶ÔÏóÊôÐÔ»ò·½·¨µÄÒýÓãº
var o=new Object();
o.name="hello";
alert(o.name); //Êä³ö“hello”
delete o.name£»
alert(o.name); //Êä³ö& ......
±¾ÎĽéÉÜÈçϼ¸¸ö·½ÃæµÄÄÚÈÝ:
1.ÈçºÎ´´½¨Êý×é
2.ÈçºÎ¶ÔÊý×é½øÐвÙ×÷£¨Ìí¼Ó,ɾ³ý,¶ÁÈ¡)
3.Êý×é³£¼û·½·¨ºÍÊôÐÔ
ÈçºÎ´´½¨Ò»¸öÊý×é,Ò»°ãµØ¸ù¾Ý³õʼ»¯É趨¼òµ¥·ÖΪ3ÖÖ:
1.µ¥´¿´´½¨Êý×é:
var arr=new Array();
Òªµã:ÓÃnew¹Ø¼ü×Ö´´½¨Êý×é¶ÔÏóArray(),Array()¶ÔÏóÊÇÒ»¸ö±¾µØÀà,¿ÉÒÔÓÃnew´´½¨Ò»¸ö¶ÔÏóºóʹÓÃ
2.´´½¨Ê ......
1.asp.netºô½Ðjs
Response.Write("<script language=javascript>");
&n ......