³£ÓÃJavaScript´úÂë
// ¹Ø±Õ´°¿Úʼþ
function closeWindow(){
if(event.clientX>document.body.clientWidth) {
event.returnValue = "ÄúÈ·¶¨Í˳öϵͳÂð£¿";
} else {
return;
}
}
window.onunload = function(){
if(event.clientX>document.body.clientWidth) {
removeChat();
form1.action = "login.do?action=logout";
form1.submit();
} else {
return;
}
};
=========================================================================
//½ûÓÃF5¼ü´úÂë
function document.onkeydown(){
if(window.event.keyCode==116){
window.event.keyCode = 0;
window.event.returnValue = false;
&n
Ïà¹ØÎĵµ£º
±¾ÎĽéÉÜÈçϼ¸¸ö·½ÃæµÄÄÚÈÝ:
1.ÈçºÎ´´½¨Êý×é
2.ÈçºÎ¶ÔÊý×é½øÐвÙ×÷£¨Ìí¼Ó,ɾ³ý,¶ÁÈ¡)
3.Êý×é³£¼û·½·¨ºÍÊôÐÔ
ÈçºÎ´´½¨Ò»¸öÊý×é,Ò»°ãµØ¸ù¾Ý³õʼ»¯É趨¼òµ¥·ÖΪ3ÖÖ:
1.µ¥´¿´´½¨Êý×é:
var arr=new Array();
Òªµã:ÓÃnew¹Ø¼ü×Ö´´½¨Êý×é¶ÔÏóArray(),Array()¶ÔÏóÊÇÒ»¸ö±¾µØÀà,¿ÉÒÔÓÃnew´´½¨Ò»¸ö¶ÔÏóºóʹÓÃ
2.´´½¨Êý×éµÄÍ ......
µ¥Ìåģʽ
Óŵã:°Ñ´úÂë×éÖ¯µÃÒ»Ö²¢¸ôÀë,¸üÈÝÒ×ÔĶÁºÍά»¤,Ìá¸ßÎȶ¨ÐÔ;ÓÃÓÚÓÅ»¯,ÌáÉýÐÔÄÜ
ȱµã:¿Éµ¼ÖÂÇ¿ñîºÏ
5.1 µ¥ÌåµÄ»ù±¾½á¹¹
var Singleton = {
attribute1 : true,
attribute2 : 10,
method1 : function(){},
method2 : function(){}
};
Ñϸñ°´¶¨ÒåÀ´Ëµ,C1²»ÊÇÒ»¸öµ¥Ìå,ÒòΪËü²»ÊÇÒ»¸ö¿ÉʵÀ ......
javascriptÖдæÔÚ¼¸ÖÖ¶ÔURL×Ö·û´®½øÐбàÂëµÄ·½·¨£ºescape()£¬encodeURI()£¬ÒÔ¼°encodeURIComponent()¡£Õ⼸ÖÖ±àÂëËùÆðµÄ×÷Óø÷²»Ïàͬ¡£
escape() ·½·¨£º
²ÉÓÃISO Latin×Ö·û¼¯¶ÔÖ¸¶¨µÄ×Ö·û´®½øÐбàÂë¡£ËùÓеĿոñ·û¡¢±êµã·ûºÅ¡¢ÌØÊâ×Ö·ûÒÔ¼°ÆäËû·ÇASCII×Ö·û¶¼½«±»×ª»¯³É%xx¸ñʽµÄ×Ö·û±àÂ루xxµÈÓÚ¸Ã×Ö·ûÔÚ×Ö·û¼¯±í ......
Á´Ê½µ÷ÓÃÊÇÒ»¸öÓï·¨ÕÐÊý.°üº¬Á½¸ö²¿·Ö:
1.Ò»¸ö´´½¨HTMLÔªËصĶÔÏóµÄ¹¤³§
2.¶ÔÕâ¸öHTMLÔªËØÖ´ÐеIJÙ×÷µÄ·½·¨
[¸öÈËÀí½â:½«HTMLÔªËØ°ü×°³É¶ÔÏó,ÔÚ¶ÔÏóÉÏÌí¼Ó·½·¨(ÖصãÔÚreturn this)]
¹¹ÔìÆ÷
(function(){
//Use a private class
function _$(els){
this.elements = [];
for(var i=0; i<els.length; ......