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

JavaScript toFixed() ·½·¨

±¾ÎÄת×Ô£ºhttp://www.w3school.com.cn/js/jsref_tofixed.asp
¶¨ÒåºÍÓ÷¨
toFixed() ·½·¨¿É°Ñ Number ËÄÉáÎåÈëΪָ¶¨Ð¡ÊýλÊýµÄÊý×Ö¡£
Óï·¨
NumberObject.toFixed(num) 
²ÎÊýnumÃèÊö±ØÐè¡£¹æ¶¨Ð¡ÊýµÄλÊý£¬ÊÇ 0 ~ 20 Ö®¼äµÄÖµ£¬°üÀ¨ 0 ºÍ 20£¬ÓÐЩʵÏÖ¿ÉÒÔÖ§³Ö¸ü´óµÄÊýÖµ·¶Î§¡£Èç¹ûÊ¡ÂÔÁ˸òÎÊý£¬½«Óà 0 ´úÌæ¡£
·µ»ØÖµ
·µ»Ø NumberObject µÄ×Ö·û´®±íʾ£¬²»²ÉÓÃÖ¸Êý¼ÆÊý·¨£¬Ð¡ÊýµãºóÓй̶¨µÄ num λÊý×Ö¡£Èç¹û±ØÒª£¬¸ÃÊý×ֻᱻÉáÈ룬Ҳ¿ÉÒÔÓà 0 ²¹×㣬ÒÔ±ãËü´ïµ½Ö¸¶¨µÄ³¤¶È¡£Èç¹û num ´óÓÚ le+21£¬Ôò¸Ã·½·¨Ö»µ÷Óà NumberObject.toString()£¬·µ»Ø²ÉÓÃÖ¸Êý¼ÆÊý·¨±íʾµÄ×Ö·û´®¡£
Å׳ö
µ± num ̫С»òÌ«´óʱÅ׳öÒì³£ RangeError¡£0 ~ 20 Ö®¼äµÄÖµ²»»áÒý·¢¸ÃÒì³£¡£ÓÐЩʵÏÖÖ§³Ö¸ü´ó·¶Î§»ò¸üС·¶Î§ÄÚµÄÖµ¡£
µ±µ÷Óø÷½·¨µÄ¶ÔÏó²»ÊÇ Number ʱÅ׳ö TypeError Òì³£¡£
ʵÀý
ÔÚ±¾ÀýÖУ¬ÎÒÃǽ«°ÑÊý×ÖÉáÈëΪ½öÓÐһλСÊýµÄÊý×Ö£º
Show the number 13.37 with one decimal:
<script type="text/javascript">
var num = new Number(13.37);
document.write (num.toFixed(1))
</script>
Êä³ö£º
Show the number 13.37 with one decimal:
13.4


Ïà¹ØÎĵµ£º

JavaScript ÕÚÕֲ㠵¯³ö¿ò

<script type="text/javas
cript">
var docEle = function() {
    return document.getElementById(arguments[0]) || false;
}
function openNewDiv(_id){
    var m = "mask";
    if (docEle(_id)) document.body.removeChild(docEle(_i ......

JavaScript ×Ö·û´®×ª»»Êý×Ö

À´Ô´£ºhttp://blog.csdn.net/yjq8116/archive/2008/11/04/3219993.aspx
·½·¨Ö÷ÒªÓÐÈýÖÖ
ת»»º¯Êý¡¢Ç¿ÖÆÀàÐÍת»»¡¢ÀûÓÃjs±äÁ¿ÈõÀàÐÍת»»¡£
1. ת»»º¯Êý
jsÌṩÁËparseInt()ºÍparseFloat()Á½¸öת»»º¯Êý¡£Ç°Õß°Ñֵת»»³ÉÕûÊý£¬ºóÕß°Ñֵת»»³É¸¡µãÊý¡£Ö»ÓжÔStringÀàÐ͵÷ÓÃÕâЩ·½·¨£¬ÕâÁ½¸öº¯Êý²ÅÄÜÕýÈ·ÔËÐУ»¶ÔÆäËûÀàÐÍ·µ» ......

Javascriptʱ¼ä²î¼ÆË㺯Êý

JavaScriptʱ¼ä²î¼ÆË㺯Êý
<mce:script language="javascript"><!--
Date.prototype.dateDiff = function(interval,objDate){
//Èô參數²»×ã»ò objDate ²»ÊÇÈÕÆÚÎï¼þ則»Ø傳 undefined
if(arguments.length<2||objDate.constructor!=Date) return undefined;
......

¼òµ¥µÄJavascript Cookie²Ù×÷

<mce:script type="text/javascript"><!--

function SetCookie(name,value,expire) {
var exp = new Date();
exp.setTime(exp.getTime() + expire);
document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
} ......

asp.netÒ³ÃæÖж¯Ì¬µØÌí¼Ójavascript½Å±¾

×î½üµÄÏîÄ¿¿ª·¢ÖÐ Óöµ½Ò»Ð©ÐèÒª¸ù¾Ý¾ßÌåÇé¿ö¶¯Ì¬Ìí¼ÓjavaScript½Å±¾£¬È»ºóÖ´Ðнű¾ ÓÚÊÇÊÕ¼¯ÁËһϣº
1 ÔڿؼþµÄ°ó¶¨Ê¼þÖÐÌí¼Ó½Å±¾ È磺ÔÚgridview¿Ø¼þµÄrowdatabindʼþÖпÉÒÔʵÏÖ Ö¸ÕëµÄÑ¡ÖÐÐв»Í¬É«ÏÔʾ ¿ÉÌí¼Ó½Å±¾
  protected void gvEngineerRepairState_RowDataBound(object sender, GridViewRowEventArgs e ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ