2014年3月24日

JavaScript prototype 属性

摘要: 转载:http://www.w3school.com.cn/jsref/jsref_prototype_array.aspprototype 属性使您有能力向对象添加属性和方法。输出:20000JS中创建类,即function 此列中employee为创建的类。var bill=new employee("Bill Gates","Engineer",1985); //实例化employee类 阅读全文

posted @ 2014-03-24 16:47 儿时精神 阅读(166) 评论(0) 推荐(0)

百度地图简易功能及说明

摘要: 转载:http://www.blogjava.net/hyljava/archive/2012/07/23/383769.html Hello, World 百度地图接口 -- 总结 运行效果图----------百度地图资料-------------------------------------------------------------------JavaScript 开源库:http://developer.baidu.com/map/library.htm拾取坐标系统:http://api.map.baidu.com/lbs... 阅读全文

posted @ 2014-03-24 16:41 儿时精神 阅读(674) 评论(0) 推荐(0)

js 函数作为参数+接受任意数量参数

摘要: /* * 求给定参数数组元素中的最大值 * * 参数num_arr array类型 * return max 数值型 */function max_num(num_arr){ //保存结果,初始化为数组的第一个元素 var max=num_arr[0]; var i=0; //循环变量初始化 //遍历数组,找出最大值放在max中 for(i;i<num_arr.length;i++) { if(max<num_arr[i]) max=num_arr[i]; } return max;}/* * 将函数作为函数参数 *... 阅读全文

posted @ 2014-03-24 15:04 儿时精神 阅读(3315) 评论(0) 推荐(0)

导航