javascript ¸¡µãÊýÔËËãµÄʱºò³ö´í ÓбȽÏÃ÷ÏÔµÄÎó²î
/********************************************************************************/
//javascriptÔÚÁ½¸ö¸¡µãÊýÔËËãµÄʱºò»áÓбȽÏÃ÷ÏÔµÄÎó²î¡£Ôö¼ÓÏÂÁз½·¨½â¾ö¡£
//2009-07-18 Skyeah
//³ý·¨º¯Êý£¬ÓÃÀ´µÃµ½¾«È·µÄ³ý·¨½á¹û
//˵Ã÷£ºjavascriptµÄ³ý·¨½á¹û»áÓÐÎó²î£¬ÔÚÁ½¸ö¸¡µãÊýÏà³ýµÄʱºò»á±È½ÏÃ÷ÏÔ¡£Õâ¸öº¯Êý·µ»Ø½ÏΪ¾«È·µÄ³ý·¨½á¹û¡£
//µ÷ÓãºaccDiv(arg1,arg2)
//·µ»ØÖµ£ºarg1³ýÒÔarg2µÄ¾«È·½á¹û
function accDiv(arg1, arg2) {
var t1 = 0, t2 = 0, r1, r2;
try { t1 = arg1.toString().split(".")[1].length } catch (e) { }
try { t2 = arg2.toString().split(".")[1].length } catch (e) { }
with (Math) {
r1 = Number(arg1.toString().replace(".", ""))
r2 = Number(arg2.toString().replace(".", ""))
return (r1 / r2) * pow(10, t2 - t1);
}
}
//¸øNumberÀàÐÍÔö¼ÓÒ»¸ödiv·½·¨£¬µ÷ÓÃÆðÀ´¸ü¼Ó·½±ã¡£
Number.prototype.div = function(arg) {
return accDiv(this, arg);
}
//³Ë·¨º¯Êý£¬ÓÃÀ´µÃµ½¾«È·µÄ³Ë·¨½á¹û
//˵Ã÷£ºjavascriptµÄ³Ë·¨½á¹û»áÓÐÎó²î£¬ÔÚÁ½¸ö¸¡µãÊýÏà³ËµÄʱºò»á±È½ÏÃ÷ÏÔ¡£Õâ¸öº¯Êý·µ»Ø½ÏΪ¾«È·µÄ³Ë·¨½á¹û¡£
//µ÷ÓãºaccMul(arg1,arg2)
//·µ»ØÖµ£ºarg1³ËÒÔarg2µÄ¾«È·½á¹û
function accMul(arg1, arg2) {
var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
try { m += s1.split(".")[1].length } catch (e) { }
try { m += s2.split(".")[1].length } catch (e) { }
return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
}
//¸øNumberÀàÐÍÔö¼ÓÒ»¸ömul·½·¨£¬µ÷ÓÃÆðÀ´¸ü¼Ó·½±ã¡£
Number.prototype.mul = function(arg) {
return accMul(arg, this);
}
//¼Ó·¨º¯Êý£¬ÓÃÀ´µÃµ½¾«È·µÄ¼Ó·¨½á¹û
//˵Ã÷£ºjavascriptµÄ¼Ó·¨½á¹û»áÓÐÎó
Ïà¹ØÎĵµ£º
Ò»¡¢Ä¬ÈϺ¯Êý
JavaScriptÌṩÁËһЩĬÈϵĺ¯Êý
±àÂ뺯Êýescape()£º½«·Ç×Öĸ¡¢Êý×Ö×Ö·ûת»»³ÉASCIIÂë
ÒëÂ뺯Êýunescape()£º½«ASCIIÂëת»»³É×Öĸ¡¢Êý×Ö×Ö·û
ÇóÖµº¯Êýeval()
ÊýÖµÅжϺ¯ÊýisNaN()£ºÅжÏÒ»¸öÖµÊÇ·ñΪ·ÇÊýÖµÀàÐÍ
ÕûÊýת»»º¯ÊýparseInt()£º½«²»Í¬½øÖÆ£¨¶þ¡¢°Ë¡¢Ê®Áù½øÖÆ£©µÄÊýֵת»»³ÉÊ®½øÖ ......
<SCRIPT LANGUAGE="JavaScript">
<!--
// Trim() , Ltrim() , RTrim()
String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "");
}
String.prototype.RTrim = functio ......
ÕýÔò±í´ïʽÊÇÒ»¸öÃèÊö×Ö·ûģʽµÄ¶ÔÏó¡£
JavaScriptµÄRegExp¶ÔÏóºÍString¶ÔÏó¶¨ÒåÁËʹÓÃÕýÔò±í´ïʽÀ´Ö´ÐÐÇ¿´óµÄģʽƥÅäºÍÎı¾¼ìË÷ÓëÌæ»»º¯ÊýµÄ·½·¨.
'***********************
' \\JavaScript//
'
'***********************
ÔÚJavaSc ......
Technorati ±êÇ©: µçÄÔÏà¹Ø
ÔÎĵØÖ·£ºhttp://www.playes.net/Blog/535.asp
IE ä¯ÀÀÆ÷µÄ½Å±¾Ê§Ð§ÊǸöÔ´Ô¶Á÷³¤µÄÎÊÌâÁË£¬ÓÐʱײÉÏÁËÄÇÒ²Ö»Äܹé½áÓÚÔµ·Ö£¬ÍêȫûµÃ½âÊÍ¡£Õâ´Î±¾È˾ÍÊÇÖдó²ÊµÄÔµ·Ö£¬±»Ð¡Ð¡µØ×²ÁËÒ»ÏÂÑü¡£
µ±È»½Å±¾Ê§Ð§Ò²ÓÐÇáÖØ£¬ÓÐʱÊÇÒ³ÃæÈ«²¿ÀÃɹ£¬Í¼Æ¬ÎÄ×ÖÈ«²¿ÏÔʾ´í룬²Ò²»È̶ã¬Æäʵ»µµÄÕâô³¹µ×·´ ......
Êý×éÊôÓÚJavaScriptÖеĸ´ºÏÊý¾ÝÀàÐÍ¡£
JavaScriptÖÐÒ»¸öÊý×é¿ÉÒÔ´æ´¢JavaScriptÖ§³ÖµÄÈκÎÊý¾ÝÀàÐÍ£¬±ÈÈç¿ÉÒÔÓÃÒ»¸öÊý×éÀ´´¦ÀíÓû§´ÓÖÐÑ¡ÔñµÄÏîÄ¿ÁÐ±í£¬»òÕßÒ»×éͼÏñ×ø±ê£¬»òÕßÒ»×éͼƬµÄÒýÓá£
´´½¨Array¶ÔÏó²¢³õʼ»¯ ......