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·½·¨ÊÇÔڹرմ°¿ÚÖ®ºóÖ´ÐУ¬²»ÊÇÔڹرմ°¿Ú֮ǰִÐУ¬Èç¹ûÄãÏëÔڹرմ°¿Ú֮ǰ×öÅжϣ¬ÇëÓõÚÒ»ÖÖ·½·¨
Ïà¹ØÎĵµ£º
/***************************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³ ......
ʼþÔ´¶ÔÏó
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 ´°Ìå ......
µÚÒ»Ìâ
(function(){
return typeof arguments;
})();
//ÎÊ×Ô¶¯Ö´Ðк¯Êý»á·µ»Øʲôֵ
// ¾ÍÊÇ¿¼Arguments¶ÔÏóµÄtypeof
// ¿´Æ½Ê±ÓÃfirebug¶à²»¶àÁË¡¡
µÚ¶þÌâ
var f = function g(){ return 23; };
typeof g();
//ÎÊ×îºóÒ»ÐеÄÖ´Ðнá¹û
//¸ù¾Ý±ê×¼£¬ÃüÃûº¯Êý±í´ïʽµÄº¯ÊýÃûÖ»¶Ôº¯Êý ......
//УÑéÊÇ·ñÈ«ÓÉÊý×Ö×é³É
function isDigit(s)
{
var patrn=/^[0-9]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéµÇ¼Ãû£ºÖ»ÄÜÊäÈë5-20¸öÒÔ×Öĸ¿ªÍ·¡¢¿É´øÊý×Ö¡¢“_”¡¢“.”µÄ×Ö´®
function isRegisterUserName(s)
{
v ......
Ä£·ÂjQuey£¬´´½¨¼¸¸ö°ü¹ü½ÚµãµÄ·½·¨£¬·¢ÏÖjQueryµÄ·½·¨ºÜµÍЧ°¡£¬ÏÂÒ»´ÎËûÓÖ¿ÉÒÔ˵Õ⼸¸ö·½·¨¿ÉÒÔÌáÉýÁ˶àÉÙ¶àÉÙÁË¡£ÔÀí»ù±¾ÊÇÕâÑù£¬Èç¹û´«ÈëµÄÊÇ×Ö·û´®£¬ÄÇôÈÃËüÃDZä³ÉÒ»¸öÔªËؽڵ㣬²»¹ýÕâÔªËؽڵãÒ²¿ÉÒÔÓÐÐí¶à²ã£¬ÔÚ×îÄÚ²ã°ÑÒª°ü¹üµÄÔªËطŽø¡£°Ñ×Ö·û´®±ä³ÉÔªËؽڵãµÄ·½·¨ÓÐÈçϼ¸¸ö¡£1£¬createElement£¬IE¿ÉÒÔÁ¬ÔªËØÊ ......