说到prototype,就不得不先说下new的过程。 我们先看看这样一段代码: 1 <script type="text/javascript"> 2 var Person = function () { }; 3 var p = new Person(); 4 </script> 1 <scrip ...
分类:
Web程序 时间:
2016-08-28 20:54:06
阅读次数:
143
function deepCopy(data) { var type = Object.prototype.toString.call(data); var o = null; if(type '[object array]') { o = []; for (var i = 0; i < data. ...
分类:
编程语言 时间:
2016-08-28 19:28:44
阅读次数:
177
<script type="text/javascript"> function mixs (){ var arg = arguments; var i = 1; target = arg[0]; for (; i < arg.length;i++) { var a = arg[i]; for (v ...
分类:
其他好文 时间:
2016-08-28 18:00:13
阅读次数:
222
定界符重新定义预防在模板中有jscss代码时smarty模板引擎解析出现错误!注意点:tpl页面模板中参数和值在php页面中对应关系。例如PHP页面代码
classDog{
var$arrT;
function__construct($arr){
$this->arrT=$arr;
}
}
//一维索引数组
$arrA=array(‘beijing‘,‘shanghai‘,‘tia..
分类:
Web程序 时间:
2016-08-28 16:44:38
阅读次数:
225
/* * 描述:判断浏览器信息 * 编写:LittleQiang_w * 日期:2016.1.5 * 版本:V1.1 */ //判断当前浏览类型 function BrowserType() { var userAgent = navigator.userAgent; //取得浏览器的userAge ...
分类:
Web程序 时间:
2016-08-28 16:29:10
阅读次数:
814
DELIMITER $$ DROP FUNCTION IF EXISTS `Fun_GetPY`$$ CREATE FUNCTION `HIS`.`Fun_GetPY` (in_string VARCHAR(21845)) RETURNS VARCHAR(21845) CHARSET utf8 BE ...
分类:
数据库 时间:
2016-08-28 16:25:57
阅读次数:
201
/*原型对象*/ /*定义原型对象的固定格式*/ function Product(){ this.name = 'iphone7' this.price = 6666 } Product.prototype = { buy:function(){}, addToCart:function(){} ... ...
分类:
其他好文 时间:
2016-08-28 12:31:36
阅读次数:
137
function Stack() { var items = []; this.push = function(element){ items.push(element); } this.pop = function(){ return items.pop(); } this.peek = func ...
分类:
编程语言 时间:
2016-08-28 12:27:48
阅读次数:
175
封装缩略图函数 function thumb($filename,$scale=0.5,$dst_w=null,$dst_h=null,$isResevesource=false,$destination=null){ list($src_w,$src_h,$imagtype)=getimagesi ...
分类:
其他好文 时间:
2016-08-28 11:15:14
阅读次数:
162