javascript ¶ÔÏóµÄpropertyºÍprototype
javascript
¶ÔÏóµÄpropertyºÍprototype
ÊÇ
ÕâÑùÒ»ÖÖ¹Øϵ
ECMAScript¿ÉÒÔʶ±ðÁ½ÖÖÀàÐ͵ĶÔÏó£¬Ò»ÖÖ½Ð×öNative ObjectÊôÓÚÓïÑÔ·¶³ë;Ò»ÖÖ½Ð×öHost Object£¬ÓÉÔËÐл·¾³Ìá
¹©ÀýÈçdocument¶ÔÏó£¬
Dom NodeµÈ
Native objectsÊÇÒ»ÖÖËÉÉ¢µÄ½á¹¹²¢ÇÒ¿ÉÒÔ¶¯Ì¬µÄÔö¼ÓÊôÐÔ(property)£¬ËùÓеÄÊôÐÔ¶¼ÓÐÒ»¸öÃû×ÖºÍÒ»¸öÖµ£¬Õâ¸öÖµ¿ÉÒÔÊÇÁíÒ»
¸ö¶ÔÏóµÄÒýÓÃ
»òÕßÊÇÄÚ½¨µÄÊý¾ÝÀàÐÍ(String, Number, Boolean, Null »òÕß Undefined)
ÏÂÃæµÄÕâ¸ö¼òµ¥µÄÀý×ÓÃèÊöÁËÒ»¸öjavascript¶ÔÏóÊÇÈçºÎÉèÖÃÒ»¸öÊôÐÔµÄÖµºÍÈçºÎ¶ÁÈ¡ÊôÐÔµÄÖµµÄ¡£
¸³Öµ²Ù×÷
Ò»¸ö¶ÔÏóµÄÊôÐԵĴ´½¨·Ç³£¼òµ¥£¬Ö±½Óͨ¹ý¸³Öµ²Ù×÷¾Í¿ÉÒÔÍê³ÉÊôÐԵĴ´½¨¡£
Java
´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://ivanl.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" wmode="transparent" src="http://ivanl.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=var%20objectRef%20%3D%20new%20Object()%3B%20%2F%2Fcreate%20a%20generic%20javascript%20object.%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="15" width="14">
var objectRef =
new
Object();
//create a generic javascript object.
var objectRef = new Object(); //create a generic javascript object.
Ò»¸öÃûΪtestNumberµÄÊôÐÔ¿ÉÒÔÕâÑù´´½¨¡£
Java
´úÂë < type="application/x-shockwave-flash" width="14" height="15" src="http://ivanl.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" wmode="transparent" src="http://ivanl.javaeye.com/javascripts/syntaxhighlighter/clipboard_new.swf" flashvars="clipboard=objectRef.testNumber%20%3D%205%3B%0A%2F*%20-%20or%3A-%20*%2F%0AobjectRef%5B%22testNumber%22%5D%20%3D%205%3B%0A" quality="high" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" height="15" width="14">
objectRef.testNumber =
5
;
/* - or:- */
objectRef["tes
Ïà¹ØÎĵµ£º
IE¹¦ÄÜ»ã×Ü
<OBJECT id=WebBrowser height=0 width=0
classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></OBJECT>
<INPUT onclick=document.all.WebBrowser.ExecWB(1,1) type=button value=´ò¿ª name=Button1>
<INPUT onclick=document.all.WebBrowser.ExecWB(4,1) type=button value=Áí´ ......
<script>
function getCookieVal(offset) {
var endstr = document.cookie.indexOf(";",offset);
if(endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset,endstr));
}
function FixCookieDate(data) {
var ba ......
ÔÚÊý°ÙÍòÕÅÒ³ÃæÖУ¬JavaScript ±»ÓÃÀ´¸Ä½øÉè¼Æ¡¢ÑéÖ¤±íµ¥¡¢¼ì²âä¯ÀÀÆ÷¡¢´´½¨cookies£¬µÈµÈµÈµÈ¡£
JavaScript ÊÇÒòÌØÍøÉÏ×îÁ÷ÐеĽű¾ÓïÑÔ£¬²¢ÇÒ¿ÉÔÚËùÓÐÖ÷ÒªµÄä¯ÀÀÆ÷ÖÐÔËÐУ¬±È·½Ëµ Internet Explorer¡¢ Mozilla¡¢Firefox¡¢Netscape¡¢ºÍ Opera¡£
ʲôÊÇ JavaScript£¿
JavaScript ±»Éè¼ÆÓÃÀ´Ïò HTML Ò³ÃæÌí¼Ó½»»¥ÐÐΪ¡£ ......
ÔÎĵØÖ·:http://www.cnblogs.com/harrychen66/archive/2008/10/10/488457.html
javascriptʵÏÖ½Ó¿Ú
ÏàÐźܶàÈËÖ®ËùÒÔ¶ÔjavascriptûÓкøÐ,¿ÉÄÜÊÇÒòΪËüÌ«ËæÒâÁË,ÀýÈ綨Òå±äÁ¿¿ÉÒÔËæÒâµÄ¼Óvar,»òÕß²»¼Ó,ÿÌõÓï¾äºóÃæµÄ¿ÉÒÔËæÒâµÄ¼ÓÉÏ";",»òÕß²»¼Ó,¿ÉÄÜ×îÄÑÈÌÊܵÄÊÇ,varÁËÒ»¸ö±äÁ¿ºó,Ëü¿ÉÒÔÊÇÈκÎÀàÐÍ,û ......
JavaScriptÖÐÓÐÒÔϳ£ÓõÄʼþ£¬ËüÃÇ¿ÉÒÔͨ¹ýJavaScriptÖеÄ×Ô¶¨Ò庯ÊýÀ´ÏìÓ¦
1.onclickʼþ
µ¥»÷ʼþ£¬¼´Óû§µ¥»÷Êó±ê°´Å¥Ê±·¢ÉúµÄʼþ£¬¿ÉÒÔÔÚÒÔÏ»ù±¾¶ÔÏóÖвúÉú¸Ãʼþ£ºbutton,radio,checkbox,submit,reset
2.onchangeʼþ
¸Ä±äʼþ£¬Í¨³£·¢ÉúÔÚÒÔÏÂÁ½ÖÖÇé¿ö
& ......