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

¡¾¾ÉÎÄ¡¿AJAX×ܽᣨ¶þ£©

ËÄ¡¢DOM
1.DOM¸ÅÊö
XHR¶ÔÏóÌṩÁ˸ú·þÎñÆ÷ͨѶµÄÄÜÁ¦£¬¶øDOMÌṩÁË·ÃÎÊ¡¢¶¯Ì¬¸üÐÂÒ³ÃæµÄÄÜÁ¦¡£
DOMÊÇW3CÍƳöµÄÎĵµ¶ÔÏóÄ£ÐÍ£¬ÊDZíʾÎĵµºÍ·ÃÎÊ¡¢²Ù×÷¹¹³ÉÎĵµµÄ¸÷ÖÖÔªËصÄAPI£¬±»¶¨ÒåΪ¶ÀÁ¢ÓÚÓïÑԵıê×¼£¬ÔÚjavascriptºÍjavaÒÔ¼°ÆäËûÓïÑÔÖж¼ÓÐʵÏÖ¡£
ÔÚDOMÖУ¬HTMLÎĵµµÄ²ã´Î»ú¹¹±»±íʾΪÊ÷Ðνṹ£¬Ê÷µÄ½Úµã±íʾÎĵµÖеĸ÷ÖÖÄÚÈÝ¡£HTMLÎĵµµÄÊ÷ÐαíʾÖ÷Òª°üº¬±íʾԪËØ»ò±ê¼Ç£¨Èç<table>ºÍ<p>£©µÄ½ÚµãºÍ±íʾÎı¾´®µÄ½Úµã¹¹³É¡£
DOM¶¨ÒåÁËÐí¶à½Ó¿Ú£¬ÆäÖбȽÏͨÓõÄÊÇÆäºËÐÄAPI£ºNodeList¡¢Node¡¢
Document¡¢Element½Ó¿Ú£¬DocumentºÍElement½Ó¿Ú¶¼ÊÇNode½Ó¿ÚµÄ×Ó½Ó¿Ú¡£ÔÚJavaScriptʵÏÖµÄDOMÖл¹°üº¬
HTMLÎĵµ×¨ÓõÄAPI£¬ÈçHTMLDocument¡¢HTMLElement¡£ÁíÍ⣬DOMΪÐí¶àHTMLÔªËض¨ÒåÁ˱ê¼ÇרÓеĽӿڣ¬Èç
HTMLBodyElement¡¢HTMLTitleElement¡£
 
2. Node½Ó¿Ú
Node½Ó¿ÚÊÇÎĵµÊ÷ÖÐËùÓнڵãµÄ¶¥¼¶¸¸½Ó¿Ú£¬¶¨ÒåÁËͨÓõÄÊôÐԺͷ½·¨¡£
³£ÓÃÊôÐÔ£º
ÊôÐÔ
˵Ã÷
nodeType
´ú±í½ÚµãµÄÀàÐÍ
nodeName
½ÚµãµÄÃû×Ö£¬Element½ÚµãÔò´ú±íElementµÄ±ê¼ÇÃû³Æ
parentNode
ÒÔNodeµÄÐÎʽ·µ»Øµ±Ç°½ÚµãµÄ¸¸½Úµã¡£Èç¹ûûÓи¸½Úµã£¬Îªnull
childNodes
ÒÔNodeListµÄÐÎʽ·µ»Øµ±Ç°½ÚµãµÄ×Ó½Úµã
firstChild
ÒÔNodeµÄÐÎʽ·µ»Øµ±Ç°½ÚµãµÄµÚÒ»¸ö×ӽڵ㣬Èç¹ûûÓÐ×ӽڵ㣬ÔòΪnull
lastChild
ÒÔNodeµÄÐÎʽ·µ»Øµ±Ç°½ÚµãµÄ×îºóÒ»¸ö×ӽڵ㣬Èç¹ûûÓÐ×ӽڵ㣬ÔòΪnull
previousSibling
ÒÔNodeµÄÐÎʽ·µ»Øµ±Ç°½ÚµãµÄÇ°Ò»¸öÐֵܽڵ㣬Èç¹ûûÓУ¬ÔòΪnull
nextSibling
ÒÔNodeµÄÐÎʽ·µ»Øµ±Ç°½ÚµãµÄÏÂÒ»¸öÐֵܽڵ㣬Èç¹ûûÓУ¬ÔòΪnull
nodeValue
Èç¹ûÊÇTextNode½Úµã£¬¸ÃÊôÐÔ´ú±í½ÚµãµÄÎı¾Öµ
×¢Ò⣺ÔÚjavaµÄʵÏÖÖУ¬ÓëÉÏÊöÊôÐÔ¶ÔÓ¦µÄÊÇget/set·½·¨£¬ÈçgetNodeType()¡¢getFirstChild()µÈ¡£
³£Ó÷½·¨£º
·½·¨
˵Ã÷
hasChildNodes()
Èç¹ûµ±Ç°½ÚµãÓµÓÐ×ӽڵ㣬Ôò·µ»Øtrue
appendChild()
°ÑÒ»¸ö½ÚµãÔö¼Óµ½µ±Ç°½ÚµãµÄchildNodes£¬¸øÎĵµÊ÷Ôö¼Ó½Úµã
removeChild()
´ÓÎĵµÊ÷ÖÐɾ³ý²¢·µ»ØÖ¸¶¨µÄ×Ó½Úµã
replaceChild()
´ÓÎĵµÊ÷ÖÐɾ³ý²¢·µ»ØÖ¸¶¨µÄ×ӽڵ㣬ÓÃÁíÒ»¸ö½ÚµãÌæ»»
insertBefore()
ÔÚµ±Ç°½ÚµãµÄÖ¸¶¨×Ó½Úµã֮ǰ²åÈëÒ»¸ö½Úµã
3. Document½Ó¿Ú
DOM Ê÷µÄ¸ù½ÚµãÊǸöDocument¶ÔÏ󣬸öÔÏóµÄdocumentElementÊôÐÔÒýÓñíʾÎĵµ¸ùÔªËصÄElement¶ÔÏ󣬶ÔÓÚHTMLÎĵµ£¬¾ÍÊÇ<html>ÔªËØ¡£Document½Ó¿ÚµÄ³£Ó÷½·¨ÓУº
·½·¨
˵Ã÷
createAttr


Ïà¹ØÎĵµ£º

ÀàËÆAjaxµ¯³ö´°¿ÚµÄDIV²ãЧ¹û´úÂë

´´½¨Ò»¸öµ¯³öDIV´°¿Ú¿ÉÄÜÊÇÏÖÔÚÍøÕ¾/ÍøÒ³ÖÆ×÷ÖÐ×î³£Åöµ½µÄÎÊÌâÖ®Ò»¡£´«Í³µÄJavaScriptµ¯´°ÒѾ­²»ÊʺÏÄ¿Ç°ÍøÕ¾µÄÉè¼ÆÀíÄîÁË£¬ÀíÓÉÓжþ£ºÊ× ÏÈ£¬²»ÓѺ×—ÉúÓ²µÄµ¯³ö¶Ô»°¿òÇÒ°éËæ×Å“ßÑ”µÄÒ»Éù¶ÔÓû§ÌåÑéÊǸöºÜ´óµÄÌôÕ½£»Æä´Î£¬¼æÈÝÐÔ²»¹»Ç¿——ÓÐÏ൱¶àµÄä¯ÀÀÆ÷ÆÁ±ÎÁËÕâÖÖJSµÄAlert() ·½·¨¡ ......

WCFÖеķþÎñºÍASP.NET AJAXÖеÄWebService

WCFµÄ¼Ü¹¹£ºusing System.ServiceModel;
ÆõÔ¼:Contract
[ServiceContract]
public partial interface IContract
{
        [OperationContract]
        string DocumentWebHostUrl();
}
·þÎñ£ºService
[ServiceBehavior(IncludeException ......

AjaX ¶þ¼¶Áª¶¯

JSP:
¿Î³ÌÃû³Æ:
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/options.js"></script>
 <html:select property="icourseId" onchange="change(this)" style="width:180px;">
      <html:opt ......

Cross Domain AJAX Enabled WCF Service

Background For the basic of how to create an AJAX enabled WCF service, please refer to MSDN: http://msdn.microsoft.com/en-us/library/bb924552.aspx. For the basic of JSONP, please refer to: http://en.wikipedia.org/wiki/JSON#JSONP. This article introduce how to make AJAX enabled WCF service support cr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ