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

Javascriptѧϰ±Ê¼ÇÖ®º¯ÊýÖØÔغÍÀàÐͼì²é

Javascriptº¯Êý°üº¬Ò»¸öαÊý×飨pseudo-array£©£¬¸ÃÊý×é°üº¬ËùÓд«Èë²ÎÊý£¬ÎÒÃDz»ÄÜÐÞ¸ÄËü£¬µ«¿ÉÒÔ·ÃÎÊÆäÖеijÉÔ±£¬¸ÃÊý×éÒ²¾ßÓÐlengthÊôÐÔ¡£
º¯ÊýÖØÔØÒÀÀµÓÚÅжϴ«Èë²ÎÊý¸öÊýºÍÀàÐ͵ÄÄÜÁ¦¡£
º¯ÊýÖØÔصÄÀý×Ó£º
<html>
<head>
<mce:script type="text/javascript"><!--
function sendMessage(msg,obj){
if(arguments.length == 2)
obj.handleMsg(msg);
else
alert(msg);
}
//Ò»¸ö½ÓÊÜÈÎÒâÊýÁ¿²ÎÊý²¢½«Æäת»»ÎªÊý×éµÄº¯Êý
function makeArray(){
var arr = [];
for(var i = 0;i < arguments.length;i++){
arr.push(arguments[i]);
}
return arr;
}
function displayerror(msg){
//Èç¹ûûÓÐÌṩ²ÎÊý£¬ÀàÐ;ÍÊÇundefined
if(typeof msg == 'undefined'){
msg = "An error occurred.";
}
alert(msg);
}
//ÓÃÒ»¸ö±äÁ¿ÀàÐÍÁбíÑϸñ¼ì²éÒ»¸ö²ÎÊýÁбí
function strict(types,args){
if(types.length != args.length){
throw "Invalid number of arguments. Expectd "+
types.length+", received "+args.length+
" instead.";
}
//±éÀúËùÓвÎÊý£¬¼ì²éÀàÐÍ
for(var i = 0;i < args.length;i++){
if(args[i].constructor != types[i]){
throw "Invalid argument type. Expectd "+
types[i].name+", received "+
args[i].constructor.name+" instead.";
}
}
}
//´òÓ¡Óû§Áбí
function userList(prefix,num,users){
//±£Ö¤prefixÊÇ×Ö·û´®£¬numÊÇÊý×Ö£¬usersÊÇÊý×é
strict([String,Number,Array],arguments);
//±éÀú'num'¸öÓû§
for(var i = 0; i < num;i++){
//ÏÔʾÿ¸öÓû§µÄÐÅÏ¢
alert(prefix+": "+users[i]);
}
}
// --></mce:script>
</head>
<body>
<a onclick="sendMessage('how are you');">call1</a>
<a onclick="sendMessage('how are you',{handleMsg:function(msg){alert('This is a customer message:' + msg);}});">call2</a>
<a onclick="alert(makeArray(1,2,3,4,5));">call3</a>
<a onclick="displayerror();">call4</a>
<a onclick="displayerror('test');">call5</a>
<a onclick="userList('test',2,[1,2,3,4,5]);">call6</a>
</b


Ïà¹ØÎĵµ£º

JavaScript »ñÈ¡¶ÔÏóµÄ¸ß¶ÈºÍ¿í¶ÈÏêϸ˵Ã÷

scrollHeight: »ñÈ¡¶ÔÏóµÄ¹ö¶¯¸ß¶È¡£
scrollLeft:ÉèÖûò»ñȡλÓÚ¶ÔÏó×ó±ß½çºÍ´°¿ÚÖÐÄ¿Ç°¿É¼ûÄÚÈݵÄ×î×ó¶ËÖ®¼äµÄ¾àÀë
scrollTop:ÉèÖûò»ñȡλÓÚ¶ÔÏó×¶ËºÍ´°¿ÚÖпɼûÄÚÈݵÄ×¶ËÖ®¼äµÄ¾àÀë
scrollWidth:»ñÈ¡¶ÔÏóµÄ¹ö¶¯¿í¶È
offsetHeight:»ñÈ¡¶ÔÏóÏà¶ÔÓÚ°æÃæ»òÓɸ¸×ø±ê offsetParent ÊôÐÔÖ¸¶¨µÄ¸¸×ø±êµÄ¸ß¶È
offsetL ......

[¾­Ñé×ܽá]½üÆÚJavaScript±à³Ì×ܽá


JavaScript
ת×Ô£º http://www.disandu.com/?p=603
============================================================================
1 ´¦ÀíXSLT  µ÷Óôø²ÎÊýµÄXSLTÄ£°åµÄ·½·¨ Ïê¼û 23Ìõ
  <html>
    <body>
       ......

JavaScript Moduleģʽ(ÒëÎÄ)


JavaScript Module Pattern
£¨
JavaScript
Module
ģʽ£© 
À´Ô´£º
1.      
http://yuiblog.com/blog/2007/06/12/module-pattern/
2.      
http://yuiblog.com/blog/2006/06/01/global-domination/
 
È«¾Ö±äÁ¿ÊÇÓкܴóΣº¦µÄ¡£ÔÚ
YU ......

JavaScriptÖеÄJSON

Ô­Ö·£ºhttp://www.dreamdu.com/blog/2008/10/19/json_in_javascript/
JavaScriptÖеÄJSON
×÷ÕߣºDouglas Crockford
Ô­ÎÄÍøÖ·£ºhttp://www.json.org/js.html
ÒëÕߣº¿É°®µÄºï×Ó
JavaScriptÕâÖÖ±à³ÌÓïÑÔÊ×ÒªµÄÄ¿µÄÊÇΪNetscape NavigatorÌṩһÖÖÒ³Ãæ½Å±¾ÓïÑÔ¡£ËüÈÔ±»ÆÕ±éµÄÈÏΪÊÇJavaµÄÒ»¸ö×Ó¼¯£¬µ«ÊÂʵ²¢·ÇÈç´Ë¡£ËüÊ ......

JavaScriptÈëÃÅѧϰÊé¼®µÄ½×¶ÎÑ¡Ôñ


¶ÔÓÚÐí¶àÏëѧϰ JavaScript µÄÅóÓÑÀ´Ëµ£¬ÎÞÒÉÈçºÎÑ¡ÔñÈëÃŵÄÊé¼®ÊÇËûÃÇ×îÍ·ÌÛµÄÎÊÌ⣬»òÐíÒ²ÊÇËûÃÇһֱη¾å£¬ÉõÖÁ·ÅÆúѧϰ JavaScript µÄÀíÓÉ¡£
ÔÚ JavaScript ·½Ã棬×Ô¼º²»ÊÇʲôר¼Ò£¬Ò²²»ÊÇʲô¸ßÊÖ£¬µ«×Ô¼ºÒ»Â·×ßÀ´£¬JavaScript ´ÓÃÔãµ½ÈëµÀ£¬¶ÔÓÚ JavaScript Êé¼®µÄÈÏʶ»òÐí»¹ÓÐЩ½è¼ø¼ÛÖµ¡£
ÈëÃÅÍƼöÊ×Ñ¡Êé¼®£º¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ