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

javascript²¶»ñ´°¿Ú¹Ø±Õʼþ


javascript²¶»ñ´°¿Ú¹Ø±ÕʼþÓÐÁ½ÖÖ·½·¨
1.ÓÃjavascriptÖØж¨Òå window.onbeforeunload()  ʼþ
ÔÚjavascriptÀﶨÒåÒ»¸öº¯Êý¼´¿É
function  window.onbeforeunload()  {  alert("¹Ø±Õ´°¿Ú")}
alert()ʼþ½«»áÔڹرմ°¿ÚÇ°Ö´ÐУ¬ÄãÒ²¿ÉÒÔÓû§¾ö¶¨ÊÇ·ñ¹Ø±Õ´°¿Ú
function  window.onbeforeunload()  { 
 if  (event.clientX>document.body.clientWidth  &&  event.clientY<0 ||event.altKey) 
     window.event.returnValue="È·¶¨ÒªÍ˳ö±¾Ò³Âð£¿";  
 }
2.ÓÃonUnload·½·¨
ÔÚbody ±êÇ©Àï¼ÓÈëonUnloadʼþ
body onUnload="myClose()"
È»ºóÔÚjavascriptÀﶨÒåmyClose()·½·¨
µ«ÊÇonUnload·½·¨ÊÇÔڹرմ°¿ÚÖ®ºóÖ´ÐУ¬²»ÊÇÔڹرմ°¿Ú֮ǰִÐУ¬Èç¹ûÄãÏëÔڹرմ°¿Ú֮ǰ×öÅжϣ¬ÇëÓõÚÒ»ÖÖ·½·¨


Ïà¹ØÎĵµ£º

ѧϰjavascriptÍƼöÍøÕ¾

/***************************by
garcon1986********************************/
 
Java is to
JavaScript what Car is to Carpet
ÂÛ̳½»Á÷£º´óÐ͵Äweb¿ª·¢ÉçÇø
http://www.webdeveloper.com/forum/index.php
W3CschoolsÖÐÎÄÕ¾£º¿ª·¢ÕßµÄʵÓÃ+ѧϰÍøÕ¾
http://www.w3school.com.cn/js/index.asp
javascript³ ......

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 ´°Ìå ......

kangax µÄjavascriptÃÕÌâ

µÚÒ»Ìâ
(function(){
return typeof arguments;
})();
//ÎÊ×Ô¶¯Ö´Ðк¯Êý»á·µ»Øʲôֵ

// ¾ÍÊÇ¿¼Arguments¶ÔÏóµÄtypeof
// ¿´Æ½Ê±ÓÃfirebug¶à²»¶àÁË¡­¡­
µÚ¶þÌâ
var f = function g(){ return 23; };
typeof g();
//ÎÊ×îºóÒ»ÐеÄÖ´Ðнá¹û

//¸ù¾Ý±ê×¼£¬ÃüÃûº¯Êý±í´ïʽµÄº¯ÊýÃûÖ»¶Ôº¯Êý ......

JavaScriptÕýÔò±í´ïʽ

//УÑéÊÇ·ñÈ«ÓÉÊý×Ö×é³É 
function isDigit(s) 

var patrn=/^[0-9]{1,20}$/; 
if (!patrn.exec(s)) return false 
return true 

//УÑéµÇ¼Ãû£ºÖ»ÄÜÊäÈë5-20¸öÒÔ×Öĸ¿ªÍ·¡¢¿É´øÊý×Ö¡¢“_”¡¢“.”µÄ×Ö´® 
function isRegisterUserName(s)
{
v ......

javascript °ü¹ü½Úµã

Ä£·ÂjQuey£¬´´½¨¼¸¸ö°ü¹ü½ÚµãµÄ·½·¨£¬·¢ÏÖjQueryµÄ·½·¨ºÜµÍЧ°¡£¬ÏÂÒ»´ÎËûÓÖ¿ÉÒÔ˵Õ⼸¸ö·½·¨¿ÉÒÔÌáÉýÁ˶àÉÙ¶àÉÙÁË¡£Ô­Àí»ù±¾ÊÇÕâÑù£¬Èç¹û´«ÈëµÄÊÇ×Ö·û´®£¬ÄÇôÈÃËüÃDZä³ÉÒ»¸öÔªËؽڵ㣬²»¹ýÕâÔªËؽڵãÒ²¿ÉÒÔÓÐÐí¶à²ã£¬ÔÚ×îÄÚ²ã°ÑÒª°ü¹üµÄÔªËطŽø¡£°Ñ×Ö·û´®±ä³ÉÔªËؽڵãµÄ·½·¨ÓÐÈçϼ¸¸ö¡£1£¬createElement£¬IE¿ÉÒÔÁ¬ÔªËØÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ