Re: ÌÖÂÛÒ»ÏÂÌÖÑáµÄscript±êÇ©

±ÈÈçAJAXȥȡһ¸öÔªËصÄÄÚÈÝ
µ±È»µÈÕû¸öÎĵµ¼ÓÔØÍê±ÏÒÔºóÔÙ¿ªÊ¼ÇëÇóÊÇ¿ÉÒÔµÄ

µ«ÊÇÊÂʵÉ϶ÔÓڴ󲿷ÖÍøÒ³ Õâ¸öʱ¼ä²îÊÇÎÞ·¨±»ºöÂÔµÄ

ÔÚ 2010Äê10ÔÂ22ÈÕ ÏÂÎç8:04£¬OOO <othree@gmail.com>дµÀ£º

> ÎÒÊǸÐÓX²»µ½ß@˜ÓµÄ±ØÒªÐÔÀ²
> focus ¶øÑÔÓÐ autofocus
> »òÔS߀ÓÐÆäËûÀý×Ó£¿
>
> ÎÒ„‚„‚¿´ÁËһϠDOM Event Level 3
> DOMNodeInsertedIntoDocument[1] ß@‚€Ê¼þËƺõÓÐüc½Ó½ü
> Ö»ÊDz»ÖªµÀ¶¨ÁxÉϵÚÒ»´Î parse Îļþ˜ä•rËã²»Ëã¾ÍÊÇ
>
> [1]:
> http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInsertedIntoDocument
>
> ÔÚ 2010Äê10ÔÂ22ÈÕÏÂÎç7:47£¬Ethan Chen <chief@ethantw.net> Œ‘µÀ£º
>  > ʵ¼ÊÉÏ×îºÃÄÜÕâÑù£º
> > <head>
> > <script>
> > document.addEventListener('elementstart', function (event) {
> >   var e = event.target
> >   if (e.tagName.toLowerCase() == 'input' && e.id="search") e.focus()
> > }, false)
> > </script>
> > </head>
> >
> > ß@ÄÜÓÃÔÚ<link type="text/css" href="./style.css">Éφ᣿¾ÍÊÇÔÚstyle.cssÝdÈëÍê³ÉÖ®áá¡£
> > ÓÈÆäÓЕrºòDOMÒѽ›readyÁË£¬˜Óʽ±í߀ÊÇ›]ÓÐÏÂÝdÍê³É¡£
> >
> >
> > ÔÚ Oct 22, 2010 7:35 PM •r£¬ John Hax Œ‘µ½£º
> >
> > Û¿·ÇµÄÒâ˼²¢²»ÊÇÕû¸ödom ready£¬¶øÊǵ¥¸öÔªËØ¿ÉÓõÄʼþ¡£
> >
> > ÕâÖÖÐèÇóÊÇ´æÔڵġ£ÒòΪҪ¶ÔÓÐЩԪËØ×öÌØÊâ½Å±¾²Ù×÷£¬Ô½ÔçÔ½ºÃ¡£
> >
> > ±ÈÈç autofocus
> >
> > ĿǰΪÁ˾¡Ôçfocus£¬ÎÒÃDZØÐ룺
> > <input id="search" ...>
> > <script>$('#search').focus()</script>
> > ʵ¼ÊÉÏ×îºÃÄÜÕâÑù£º
> > <head>
> > <script>
> > document.addEventListener('elementstart', function (event) {
> >   var e = event.target
> >   if (e.tagName.toLowerCase() == 'input' && e.id="search") e.focus()
> > }, false)
> > </script>
> > </head>
> > Õâ¸öÊÇelementstart£¬¼´µ±Ê±elementµÄ×ÓÔªËØ»¹Ã»ÓÐready£¬Ö»ÄÜ»ñµÃ¸ÃelementµÄÊôÐÔ¡£
> > ÁíÒ»ÖÖÊÇelementend£¬¼´µ±Ê±elementÒѾ­ÍêÈ«ready¡£
> > ¾Ù¸öÐèÇóµÄÀý×Ó£¬¸ù¾ÝÔ¤ÏÈÖ¸¶¨µÄ·½Ê½¶ÔtableÖеÄÏîÄ¿½øÐÐÅÅÐò£º
> > var sortTableBy = location.hash
> > document.addEventListener('elementend', function (event) {
> >   var e = event.target
> >   if (e.tagName.toLowerCase() == 'table') {
> >      sortTableByCol(e, sortTableBy)
> >   }
> > }, false)
> >
> >
> >
> > Ä¿Ç°±ê×¼ÊÇûÓÐelementstart/endÕâÖÖʼþµÄ¡£Ö»ÓÐhtc£¨IE6,IE7£©ºÍxbl£¨FF£©²ÅÄܸÉelementendÕâÖÖÊÂÇé¡£
> >
> > 2010/10/22 OOO <othree@gmail.com>
> >>
> >> ¬FÔÚÓÐ DOMContentLoaded ʼþ
> >> Ó|°l•régÊÇÔÚ Îļþ˜ä½¨ºÃ £¬é_ʼ render Ç°
> >>
> >> jQuery µÄ Ready ¾ÍÊÇ•þÏÈ¿´žgÓ[Æ÷Ö®²»Ö§Ô®ß@‚€Ê¼þ
> >> ²»Ö§Ô®µÄÔ’(IE)•þ¸ÄÓà IE hack
> >> Ò»Ö±Ô‡Öø scroll
> >> ›]×xÍêµÄÔ’ scroll ¶¼•þʧ”¡
> >>
> >> ß@²¿·ÝµÄ×hî}‘ªÔ“ÊÇ DOM µÄ²¿·Ý
> >> ºÍ script ˜Ë»`›]êP‚S²ÅÊÇ
> >>
> >> script ˜Ë»`¬FÔÚÓбÈÝ^²»Í¬µÄÊÇ async ºÍ defer ƒÉ‚€ŒÙÐÔ
> >>
> >> ÔÚ 2010Äê10ÔÂ22ÈÕÏÂÎç6:59£¬ÖÜÔ£²¨ <itchina110@gmail.com> Œ‘µÀ£º
> >> > ÎҼDz»Ì«Çå³þÁË£¬ºÃÏñÏÖÔÚÊÇÒýÈëÁËÕâÑùÒ»¸öʼþ£¬ÓеãÀàËÆjqueryµÄready·½Ê½
> >> > ÔÚ 2010Äê10ÔÂ22ÈÕ ÏÂÎç6:55£¬Û¿·Ç³Ì <csf178@gmail.com>дµÀ£º
> >> >>
> >> >> ´ó¼ÒÓ¦¸Ã¶¼Óöµ½¹ýÒ»ÖÖ³¡¾°£¬Ò»¶Î½Å±¾ÒªÔÚijһԪËØ´´½¨ÒÔºóÁ¢¼´Ö´ÐУº
> >> >>
> >> >> <div id="content">
> >> >> </div>
> >> >> <script type="text/javascript">
> >> >>  //do something
> >> >> </script>
> >> >>
> >> >> ÕâÊÇÒ»ÖÖºÜÔã¸âµÄ×ö·¨£¬ÖÁÉÙÓÐ2¸öÑÏÖØÎÊÌ⣺
> >> >>
> >> >>
> >> >>
> 1.script±êÇ©½«×èÈûäÖȾỊ̈߳¬ÒòΪҪÕչ˵½document.writeÕâÖÖа¶ñµÄд·¨£¬ºóÃæµÄäÖȾ±ØÐëµÈ´ý½Å±¾Ö´ÐÐÍê±Ï£¬Õâ¶ÔÓÚÒýÓõ¥¶ÀJSÎļþµÄscript±êÇ©¸ü¼ÓÖÂÃü£¬äÖȾ±ØÐëµÈ´ýJSÎļþÏÂÔØ¡£
> >> >>
> >> >> 2.ÐÐΪºÍ±íÏÖÎÞ·¨³¹µ×·ÖÀ룬JS´úÂëÒ²ÎÞ·¨ºÍHTML´úÂë·ÖÀë
> >> >>
> >> >> ËùÒÔÎÒÔÚÏëÊÇ·ñ¿ÉÒÔÒýÈëһʼþ
> >> >>
> >> >> body.onElementLoad=function(element) {
> >> >>     if(element.id=="content"){
> >> >>         //do something
> >> >>     }
> >> >> }
> >> >>
> >> >> ´ó¼Ò˵˵×Ô¼ºµÄÏë·¨
> >> >
> >> >
> >> > --
> >> > ´ËÖÂ
> >> >
> >> > Mr. Zhou YuBo - ÖÜÔ£²¨
> >> >
> >> >  Óʼþ£ºitchina110@gmail.com
> >> >  µç»°£º13717517540
> >> >
> >>
> >>
> >>
> >> --
> >> OOO
> >
> >
> >
>
>
>
> --
> OOO
>

Received on Friday, 22 October 2010 13:02:11 UTC