javascript ÑéÖ¤´úÂëÕûÀí
//the common event,If your brower is firefox,you should use this function instead of "window.event"
function getEvent() {
if(document.all)
return window.event; //get ie event
func=getEvent.caller;
while(func!=null) {
var arg0=func.arguments[0];//alert(arg0);
if(arg0) {
if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)) {
return arg0;
}
}
func=func.caller;
}
return null;
}
//È¥³ý×ó²à¿Õ¸ñ
function LTrim(str)
{
return str.replace(/^\s*/g,"");
}
//È¥ÓÒ¿Õ¸ñ
function RTrim(str)
{
return str.replace(/\s*$/g,"");
}
//È¥µô×Ö·û´®Á½¶ËµÄ¿Õ¸ñ
function trim(str)
{
return str.replace(/(^\s*)|(\s*$)/g, "");
}
//È¥³ý×Ö·û´®Öмä¿Õ¸ñ
function CTim(str)
{
return str.replace(/\s/g,'');
}
//ÊÇ·ñΪÓÉÊý×Ö×é³ÉµÄ×Ö·û´®
function is_digitals(str)
{
var reg=/^[0-9]*$/;//Æ¥ÅäÕûÊý
return reg.test(str);
}
//ÑéÖ¤ÊÇ·ñΪÕûÊý£¬°üÀ¨Õý¸ºÊý£»
function Is_Int(str)
{
var reg=/^(-|\+)?\d+$/;
return reg.test(str);
}
//ÊÇ´óÓÚ0µÄÕûÊý
function Is_positive_num(str)
{
var reg=/^\d+$/;
return reg.test(str);
}
//¸ºÕûÊýµÄÑéÖ¤
function Is_minus(str)
{
var reg=/^-\d+$/;
return reg.test(str);
}
//ÑéÖ
Ïà¹ØÎĵµ£º
×î½ü×öÒ»¸ö¹«Ë¾µÄÒµÎñϵͳ£¬¹«Ë¾ÒªÇóÄܾ¡¿ÉÄܵÄÓëc/s½üËÆ£¬Ò²¾ÍÊÇÈçc/sÒ»Ñù£¬µã»÷Îı¾¿ò¿ÉÒÔµ¯³ö´ËÏîÄ¿µÄÏà¹ØÄÚÈÝ£¬½øÐÐÑ¡ÔñÊäÈë¡£
ÎÒʹÓÃÁ˵¯³ö´°¿Ú£¬È»ºóÔÚ×Ó´°¿ÚË«»÷Ñ¡ÖÐÏîÄ¿£¬°ÑÑ¡ÖеÄÖµ·µ»Ø¸ø¸¸´°Ìå¡£
ÔÚϵͳ×öÍêÁËÖ®ºó£¬ÔÚ¿Í»§Ê¹ÓõĹý³Ì£¬ÓÉÓÚ¿Í»§Ê¹ÓõÄÊÇ512m ......
event.keycode´óÈ«(javascript)
keycode 8 = BackSpace BackSpace
keycode 9 = Tab Tab
keycode 12 = Clear
keycode 13 = Enter
keycode 16 = Shift_L
keycode 17 = Control_L
keycode 18 = Alt_L
keycode 19 = Pause
keycode 20 = Caps_Lock
keycode 27 = Escape Escape
keycode 32 = space space
......
ʼþÔ´¶ÔÏó
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
´°Ìå»î¶¯ÔªËØ
d ......
JS Check£º
javascriptlint http://www.javascriptlint.com/index.htm
jslint http://www.jslint.com/
JS UT£º
http://www.jsunit.net/
JS ST£º
http://www.outofhanwell.com/ieleak/index.php?title=Main_Page Drip
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
http://blogs.msdn. ......
Build your web applications quickly and easily using the industry leading web application IDE -- Aptana Studio.
Introduction:
Aptana Studio is a complete web development environment that combines powerful authoring tools for HTML, CSS, and JavaScript, along with thousands of additional plugins ......