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
Ïà¹ØÎĵµ£º
Ò»°ãʼþ ʼþ ä¯ÀÀÆ÷Ö§³Ö ÃèÊö
onClick IE3|N2|O3 Êó±êµã»÷ʼþ£¬¶àÓÃÔÚij¸ö¶ÔÏó¿ØÖƵķ¶Î§ÄÚµÄÊó±êµã»÷
onDblClick IE4|N4|O Êó±êË«»÷ʼþ
onMouseDown IE4|N4|O Êó±êÉϵİ´Å¥±»°´ÏÂÁË
onMouseUp IE4|N4|O Êó±ê°´Ïºó£¬ËÉ¿ªÊ±¼¤·¢µÄ ......
ͻȻ¼äÏëÈ¥ÏÂÊ×fire in the holeµÄÁåÉù£¬ÓÚÊÇÓÃsosoÕÒÁËһϣ¬½øÈëÁËÊÖ»úÀÖÔ° £¨http://download.shouji.com.cn/do/wave?html=&inputname=wave&wname=Fire+in+the+hole+&thsubmit=%E6%90%9C%E7%B4%A2£©£¬Ñ¡Ôñfire in the hole£¬µ¯³ö¸ö´°¿Ú£¬ÌáʾÈÃÊäÈëÊÖ»úºÅÂë¡£ÔÎËÀ£¬²»¾ÍÏÂÊ׸èÂ»¹²»ÈÃÖ±½ÓÏ¡£ºÇºÇ£¬·¢Ï ......
×Ô¼ºÔÚ¿ª·¢ÖÐÅöµ½µÄ+ÁËһЩÔÚÍøÉÏËѵ½µÄ¡£¡£ºÍ´ó¼Ò·ÖÏíÏ¡£
DropdownlistÎÞˢеÄÀý×Ó¡£xml.
ÀýÈçÎı¾ÑéÖ¤!
ÏÂÃæÊÇÒ»¸öµ¥Ñ¡°´Å¦Ç°Ì¨²»Ë¢ÐµÄÀý×Ó.ÓкõľÍÍùÉÏÌù
<mce:script language="javascript"><!--
function SetButton()
{
if(document.all.rdoByHuman.checked==true)
{
......
var o = ['Äã', 'da', 'Äã', 123, 'fm', 'fm', 'da', 123, 'fm', 123];
var n = [];
var s = -1;
var t = null;
o.sort();
for(var i = 0; i < o.length; i++)
{
if(o[i] != t)
{
s += 1;
n[s] = [];
}
......