¡¾×ª¡¿JavaScriptÅжÏä¯ÀÀÆ÷ÀàÐͼ°°æ±¾
ÄãÖªµÀÊÀ½çÉÏÓжàÉÙÖÖä¯ÀÀÆ÷Â𣿳ýÁËÎÒÃÇÊìÖªµÄIE, Firefox, Opera, SafariËÄ´óä¯ÀÀÆ÷Ö®Í⣬ÊÀ½çÉÏ»¹Óнü°ÙÖÖä¯ÀÀÆ÷¡£
¼¸ÌìÇ°£¬ä¯ÀÀÆ÷¼Ò×åÓиյ®ÉúÁËһλСÍõ×Ó£¬¾ÍÊÇGoogleÍƳöµÄChromeä¯ÀÀÆ÷¡£ÓÉÓÚChrome³öÉúÃûÃÅ£¬¾¡¹ÜËû»¹ÊǸöС¼Ò»ï£¬Ã»ÓÐÈ˸ÒС¿´Ëû¡£ÒÔºó£¬ÔÛÃdz£Ëµä¯ÀÀÆ÷µÄ“ËÄ´ó²Å×Ó”¾ÍµÃ¸Ä³ÆΪ“Îå¶ä½ð»¨”ÁË¡£
ÔÚÍøվǰ¶Ë¿ª·¢ÖУ¬ä¯ÀÀÆ÷¼æÈÝÐÔÎÊÌâ±¾ÒÑÈÃÎÒÃÇÊÖæ½ÅÂÒ£¬ChromeµÄ³öÊÀ²»ÖªµÀÓÖÒª¸øÎÒÃÇÌí¶àÉÙÂÒ×Ó¡£ä¯ÀÀÆ÷¼æÈÝÐÔÊÇÇ°¶Ë¿ª·¢¿ò¼ÜÒª½â¾öµÄµÚÒ»¸öÎÊÌ⣬Ҫ½â¾ö¼æÈÝÐÔÎÊÌâ¾ÍµÃÊ×ÏÈ׼ȷÅжϳöä¯ÀÀÆ÷µÄÀàÐͼ°Æä°æ±¾¡£
JavaScriptÊÇÇ°¶Ë¿ª·¢µÄÖ÷ÒªÓïÑÔ£¬ÎÒÃÇ¿ÉÒÔͨ¹ý±àдJavaScript³ÌÐòÀ´ÅжÏä¯ÀÀÆ÷µÄÀàÐͼ°°æ±¾¡£JavaScriptÅжÏä¯ÀÀÆ÷ÀàÐÍÒ»°ãÓÐÁ½ÖÖ°ì·¨£¬Ò»ÖÖÊǸù¾Ý¸÷ÖÖä¯ÀÀÆ÷¶ÀÓеÄÊôÐÔÀ´·Ö±æ£¬ÁíÒ»ÖÖÊÇͨ¹ý·ÖÎöä¯ÀÀÆ÷µÄuserAgentÊôÐÔÀ´Åжϵġ£ÔÚÐí¶àÇé¿öÏ£¬ÖµÅжϳöä¯ÀÀÆ÷ÀàÐÍÖ®ºó£¬»¹ÐèÅжÏä¯ÀÀÆ÷°æ±¾²ÅÄÜ´¦Àí¼æÈÝÐÔÎÊÌ⣬¶øÅжÏä¯ÀÀÆ÷µÄ°æ±¾Ò»°ãÖ»ÄÜͨ¹ý·ÖÎöä¯ÀÀÆ÷µÄuserAgent²ÅÄÜÖªµÀ¡£
ÎÒÃÇÏÈÀ´·ÖÎöһϸ÷ÖÖä¯ÀÀÆ÷µÄÌØÕ÷¼°ÆäuserAgent¡£
IE
Ö»ÓÐIEÖ§³Ö´´½¨ActiveX¿Ø¼þ£¬Òò´ËËýÓÐÒ»¸öÆäËûä¯ÀÀÆ÷ûÓеĶ«Î÷£¬¾ÍÊÇActiveXObjectº¯Êý¡£Ö»ÒªÅжÏwindow¶ÔÏó´æÔÚActiveXObjectº¯Êý£¬¾Í¿ÉÒÔÃ÷È·Åжϳöµ±Ç°ä¯ÀÀÆ÷ÊÇIE¡£¶øIE¸÷¸ö°æ±¾µäÐ͵ÄuserAgentÈçÏ£º
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)
Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.2)
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
Mozilla/4.0 (compatible; MSIE 5.0; Windows NT)
ÆäÖУ¬°æ±¾ºÅÊÇMSIEÖ®ºóµÄÊý×Ö¡£
Firefox
FirefoxÖеÄDOMÔªËض¼ÓÐÒ»¸ögetBoxObjectForº¯Êý£¬ÓÃÀ´»ñÈ¡¸ÃDOMÔªËصÄλÖúʹóС£¨IE¶ÔÓ¦µÄÖÐÊÇgetBoundingClientRectº¯Êý£©¡£ÕâÊÇFirefox¶ÀÓеģ¬ÅжÏËü¼´¿
Ïà¹ØÎĵµ£º
µÚ9Õ ´úÂë·ç¸ñ
¼ÆËã»ú³ÌÐòÊÇÈËÀàÖÆÔì³öÀ´µÄ×ÔÓµÄÊÂÎï¡£³ÌÐòͨ³£Óɺܶಿ·Ö×é³É£¬±íÏÖΪº¯Êý¡¢Óï¾äºÍ±í´ïʽ£¬ËüÃDZØÐë׼ȷÎÞÎóµØ°´ÕÕ˳ÐòÅÅÁС£×îÖյĽá¹û¼¸ºõ¶¼ºÍʵÏÖËüµÄ³ÌÐòûÓÐʲôÏàËÆÖ®´¦¡£ÔÚÈí¼þµÄ²úÆ·ÉúÃüÖÜÆÚÖУ¬Í¨³£ËüÃǶ¼»á±»Ð޸ġ£°ÑÒ»¸öÕýÈ·µÄ³ÌÐòת»¯ÎªÁíÒ»¸öͬÑùÕýÈ·µ«·ç¸ñ²»Í¬µÄ³ÌÐò£¬ÊÇÒ»¸ö¼«¾ß ......
JavascriptÖеij£¼ûÎÊÌâ
1. ¼¯ºÏÀà¶ÔÏóÎÊÌâ
ÏÖÓдúÂëÖÐÐí¶à¼¯ºÏÀà¶ÔÏóÈ¡ÓÃʱʹÓà ()£¬IE ÄܽÓÊÜ£¬Firefox ²»ÄÜ¡£
½â¾ö·½·¨£º¸ÄÓà [] ×÷ΪϱêÔËËã¡£È磺document.forms("formName") ¸ÄΪ
Js´úÂë
document.forms[
"formName"
];
//ÓÖÈ磺
document.getEle ......
flashÓëjavascriptµÄ½»»¥¿ÉÄÜÌÖÂ۵ıȽ϶à,½ñÌìΪ´ó¼Ò½éÉÜÏÂÈçºÎʹÓÃflexÓëjavascript½øÐн»»¥
Ò»¡¢ÔÚJavaScriptÖе÷ÓÃFlex·½·¨
ÔÚFlexÖпÉÒÔÓÃExternalInterfaceÀ´µ÷ÓÃFlexµÄ·½·¨£¬Í¾¾¶ÊÇ
1.ͨ¹ýÔÚFlexÓ¦Óÿɵ÷Ó÷½·¨ÁбíÖÐÌí¼ÓÖ¸¶¨µÄ¹«Ó÷½·¨¡£ÔÚFlexÓ¦ÓÃÖÐͨ¹ýµ÷ÓÃaddCallback()¿ÉÒÔ°ÑÒ»¸ö·½·¨Ìí¼Óµ½´ËÁбíÖС£addC ......
дÏÂÒ»¸ö¹ØÓÚÓÃÕýÔò±í´ïʽÑéÖ¤±íµ¥µÄ´úÂ룬ÒÔºó¿ÉÒÔÓõ½¡£
function checkform(){
var null_regu = /^[ ]*$/;
var age_regu = /^[1-9][0-9]$/;
var tel_regu = /^[0-9]*(-){0,1}[0-9]{8,11}$/;
var email_regu=/^[\w]+[\w-\.]*@([\w]+\.)+[\w]+$/;
var qq_regu=/^(\d+){6,12}/;
if(new RegExp(null_regu ......