
JavaScript
a15140288018
这个作者很懒,什么都没留下…
展开
-
JavaScript Detecting Arrays
原创 2013-03-15 11:26:01 · 141 阅读 · 0 评论 -
JavaScript中substring和substr区别
1.substring 方法 定义和用法 substring 方法用于提取字符串中介于两个指定下标之间的字符。 语法 stringObject.substring(start,stop) 参数 描述 start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。 stop 可选。一个非负的整数,比要提取的子串的最后一个字符在 st...原创 2012-12-11 15:03:03 · 95 阅读 · 0 评论 -
JavaScript for...in循环语句
for(变量in 集合或对象) { 执行语句块} <scriptlanguage="javascript"> varas= [1,4,5,6], output=""; for(varx in as){ output += " x= " + ...原创 2012-11-07 14:50:04 · 115 阅读 · 0 评论 -
JavaScript 或(||)运算符的妙用
var Book = function(author, title){ this.author = author || 'no author'; this.title = title || 'no title';}原创 2013-03-21 15:42:23 · 193 阅读 · 0 评论 -
JavaScript The random() and other Methods of the Math object
The random() Method The Math.random() method returns a random number between the 0 and the 1, not including either 0 or 1. This is a favorite tool of web sites that are trying to display r...原创 2013-03-18 18:13:31 · 121 阅读 · 0 评论 -
JavaScript Rounding Methods of the Math object
The next group of methods has to do with rounding decimal values into integers. Three methods — Math.ceil(), Math.floor(), and Math.round() — handle rounding in different ways as described her...原创 2013-03-18 17:59:39 · 121 阅读 · 0 评论 -
JavaScript The min() and max() Methods of the Math object
原创 2013-03-18 17:51:19 · 117 阅读 · 0 评论 -
JavaScript The min() and max() Methods of the Math object
原创 2013-03-18 17:50:20 · 97 阅读 · 0 评论 -
JavaScript The Number Type
原创 2013-03-18 17:09:14 · 120 阅读 · 0 评论 -
JavaScript Reduction Methods of Array
原创 2013-03-16 08:41:28 · 100 阅读 · 0 评论 -
JavaScript Iterative Methods of Array
原创 2013-03-15 15:12:53 · 109 阅读 · 0 评论 -
JavaScript Location Methods of Array
原创 2013-03-15 15:01:09 · 109 阅读 · 0 评论 -
JavaScript Manipulation Methods of Array
原创 2013-03-15 14:25:02 · 110 阅读 · 0 评论 -
JavaScript Reordering Methods of Array
原创 2013-03-15 13:59:51 · 86 阅读 · 0 评论 -
JavaScript 性能优化之 for 语句
在开发时,很多开发者都会用到for语句与数组做循环来做查询;但手机的性能对循环数据一旦超过5000条数据(例如I9008手机)将会很吃力,所以建议开发者用for语句来做循环查询时,最好用以下的方法来做查询:把 for(var i = 0, len = array.length; i < len; i++){ if(array[i] == key){ ...原创 2012-10-30 17:45:35 · 114 阅读 · 0 评论 -
js中apply方法的使用
1、对象的继承,一般的做法是复制:Object.extendprototype.js的实现方式是: Object.extend = function(destination, source) { for (property in source) { destination[property] = source[property]; } re...原创 2013-09-25 10:20:50 · 137 阅读 · 0 评论