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

JavaScript£ºprototypeÊôÐÔʹÓ÷½·¨

Ò»¡¢»ù±¾Ê¹Ó÷½·¨
      prototypeÊôÐÔ¿ÉËãÊÇJavaScriptÓëÆäËûÃæÏò¶ÔÏóÓïÑÔµÄÒ»´ó²»Í¬Ö®´¦¡£
¼ò¶øÑÔÖ®£¬prototype¾ÍÊǓһ¸ö¸øÀàµÄ¶ÔÏóÌí¼Ó·½·¨µÄ·½·¨”£¬Ê¹ÓÃprototypeÊôÐÔ£¬¿ÉÒÔ¸øÀද̬µØÌí¼Ó·½·¨£¬ÒÔ±ãÔÚJavaScriptÖÐʵÏÖ“¼Ì³Ð”µÄЧ¹û¡£
      ¾ßÌåÀ´Ëµ£¬prototype ÊÇÔÚ IE 4 ¼°ÆäÒÔºó°æ±¾ÒýÈëµÄÒ»¸öÕë¶ÔÓÚijһÀàµÄ¶ÔÏóµÄ·½·¨£¬µ±ÄãÓÃprototype±àдһ¸öÀàºó£¬Èç¹ûnewÒ»¸öеĶÔÏó£¬ä¯ÀÀÆ÷»á×Ô¶¯°ÑprototypeÖеÄÄÚÈÝÌæÄ㸽¼ÓÔÚ¶ÔÏóÉÏ¡£ÕâÑù£¬Í¨¹ýÀûÓÃprototype¾Í¿ÉÒÔÔÚJavaScriptÖÐʵÏÖ³ÉÔ±º¯ÊýµÄ¶¨Ò壬ÉõÖÁÊÇ“¼Ì³Ð”µÄЧ¹û¡£
      Ò»¸ö¼òµ¥µÄʾÀýÈçÏ£º
view plaincopy to clipboardprint?
Number.prototype.add = function(num){return(this+num);} 
Number.prototype.add = function(num){return(this+num);}
ÕâÊǶÔÒÑÓÐÀàÌí¼Ó·½·¨¡£ÕâÑùд£¬¿ÉÒÔÔöÇ¿ÒÑÓÐÀàµÄ¹¦ÄÜ£¬ÀýÈç¿ÉÒÔ¸øArrayÀàÔö¼Ópush·½·¨ÈçÏ£º
view plaincopy to clipboardprint?
Array.prototype.push = function(new_element){  
        this[this.length]=new_element;  
        return this.length;  
    } 
Array.prototype.push = function(new_element){
        this[this.length]=new_element;
        return this.length;
    }
¶ÔÓÚ×Ô¶¨ÒåµÄÀࣨ»òÕ߳ƺ¯Êý¶ÔÏ󣩣¬Ò²¿ÉÒÔÕâÑùд£º
view plaincopy to clipboardprint?
function MyApplication() {  
    this.counter = 0;  
    this.map = new GMap2(document.getElementById("map_canvas"));  
      this.map.setCenter(new GLatLng(39.917,116.397), 14);  
      GEvent.bind(this.map, "click", this, this.onMapClick);  
    }  
          
    MyApplication.prototype.onMapClick = fu


Ïà¹ØÎĵµ£º

JavaScriptʼþ¼¯

Ò»°ãʼþ Ê¼þ ä¯ÀÀÆ÷Ö§³Ö ÃèÊö 
onClick IE3|N2|O3 Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷ 
onDblClick IE4|N4|O Êó±êË«»÷ʼþ 
onMouseDown IE4|N4|O Êó±êÉϵİ´Å¥±»°´ÏÂÁË 
onMouseUp IE4|N4|O Êó±ê°´Ïºó£¬ËÉ¿ªÊ±¼¤·¢µÄ ......

javascriptС¼¼ÇÉ(ת)


ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture(); 
event.srcElement.releaseCapture(); 
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
event.y
´° ......

Javascript ´¦Àí Ctrl+s ºÍ Tab °´¼üÏìӦʼþ

getkey ÓÃÓÚ»ñµÃ°´¼üµÄÏàÓ¦´úÂë, getevÓÃÓÚ»ñµÃÏìӦʼþ
<script>
    function getkey(e)
    {
        var key;
        if(document.all)
        {
      ......

javascriptµ÷Óø¸´°¿Ú£¨¸¸Ò³Ã棩µÄ·½·¨

javascriptµ÷Óø¸´°¿Ú£¨¸¸Ò³Ã棩µÄ·½·¨
window.parentÓëwindow.openerµÄÇø±ð javascriptµ÷ÓÃÖ÷´°¿Ú·½·¨
1£º   window.parent ÊÇiframeÒ³Ãæµ÷Óø¸Ò³Ãæ¶ÔÏó
¾ÙÀý:
a.html
Html´úÂë
<html>  
    <head><title>¸¸Ò³Ãæ</title></head> &nb ......

JavaScriptÀï×Ö·û´®ÀàÐÍת»»³ÉÈÕÆÚÀàÐÍ


JavaScriptÀï×Ö·û´®ÀàÐÍת»»³ÉÈÕÆÚÀàÐÍ£º
Èç¹û×Ö·û´®ÖÐÓпոñ»òÊÇÆäËû·Ö¸î·û·Ö¸î£¬¿ÉÒÔÓÃsplit·½·¨ÏȲð·Ö£¬·µ»ØÒ»¸öÊý×飬ÔÙ°ÑÕâ¸öÊý×éÀïµÄÄêÔÂÈÕ×÷Ϊ²ÎÊý´«µ½new Date()ÀïÉú³ÉÈÕÆÚÀàÐÍ£»
Èç¹ýûÓÐÌØÊâ·Ö¸ô·û£¬¿ÉÒÔÓÃsubstr£¨x£¬y£©·½·¨À´È¡×Ó×Ö·û´®À´Éú³ÉÈÕÆÚ£¬substr£¨x£¬y£©Àx±íʾȡ×Ö´®µÄ¿ªÊ¼Î»Öã¬y±íʾ×Ó´®µÄ³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ