jQuery

来源:互联网 发布:mysql root用户权限 编辑:程序博客网 时间:2024/05/29 07:36
1.JavaScript内置对象
Array:用于在单独的变量名中存储一系列的值。
String:用于支持对字符串的处理。
Math:用于执行常用的数学任务,它包含了若干个数字常量和函数。
Date:用于操作日期和时间。
2.Math对象
  常用方法
方法  说 明     示例
ceil()       对数进行上舍入      Math.ceil(25.5);返回26、Math.ceil(-25.5);返回-25
floor()      对数进行下舍入      Math.floor(25.5);返回25、Math.floor(-25.5);返回-26
round()      把数四舍五入为最接近的数       Math.round(25.5);返回26、Math.round(-25.5);返回-26
random()     返回0~1之间的随机数     Math.random();例如:0.6273608814137365
如何实现返回的整数范围为2~99?====》var iNum=Math.floor(Math.random()*98+2);
3.Date对象
语法:var 日期对象=new Date(参数)
      参数格式:MM DD,YYYY,hh:mm:ss
4.Date对象的方法
方法   说 明
getDate() 返回 Date 对象的一个月中的每一天,其值介于1~31之间
getDay() 返回 Date 对象的星期中的每一天,其值介于0~6之间
getHours() 返回 Date 对象的小时数,其值介于0~23之间
getMinutes() 返回 Date 对象的分钟数,其值介于0~59之间
getSeconds() 返回 Date 对象的秒数,其值介于0~59之间
getMonth() 返回 Date 对象的月份,其值介于0~11之间
getFullYear() 返回 Date 对象的年份,其值为4位数
getTime() 返回自某一时刻(1970年1月1日)以来的毫秒数
注:1、getDay():0-表示周日,1-表示周1,6-表示周6。
    2、getMonth():0-11,0表示1月分,11表示12月份。

原创粉丝点击