码迷,mamicode.com
首页 >  
搜索关键字:function    ( 54714个结果
js 不要使用new
(1)不要使用new Array(),new Number, new String, or new Boolean. 等等如果要新建数组,没有必要使用new Array(),使用[];原因是直观。(2)不要使用new Function 来创建函数如果要写代码:myObj = new function...
分类:Web程序   时间:2014-08-05 10:41:49    阅读次数:477
easyui日期在未加载easyui-lang-zh_CN.js出现英文的情况下加载中文的方法
我们有时候在操作easyui的时候本来是加载了easyui-lang-zh_CN.js中文文件包,但是还是出现了英文。使得我们不得埋怨这框架咋这么不好用,其实我们仔细看看这个中文包就会发现里面很多都是重新修改了定义语言的参数。假如我们用jquery初始化加载方法$(function(){//这里是....
分类:Web程序   时间:2014-08-05 09:30:48    阅读次数:317
JavaScript实现计算器功能
截图 :cal.jsJs代码varClass={};Class.calculation=function(){varcalculation={};calculation.result=0;calculation.calculate=function(num1,num2){};calculation....
分类:编程语言   时间:2014-08-05 09:27:18    阅读次数:294
cmake函数参数解析
最近在迁移公司的make系统到cmake上,发现cmake的function参数很奇怪。例如,如果我们向一个function传递list作为参数,在function中,形参会变成如下状况: set(SRC) list(APPEND SRC a.cpp b.cpp) list(APPEND SRC c.cpp d.cpp) function(tst_arguments src_list) me...
分类:其他好文   时间:2014-08-05 03:05:18    阅读次数:317
Metric Space
Metric spaces is a large class of spaces on which the closeness of two points is depicted by a distance function, or called a metric. Metric spaces ar...
分类:其他好文   时间:2014-08-05 03:04:28    阅读次数:220
Javascript面向对象拖拽
function Drag(id){ var _this=this; this.disX=0; this.disY=0; this.oDiv=document.getElementById(id); this.oDiv.onmousedown=funct...
分类:编程语言   时间:2014-08-05 03:01:58    阅读次数:187
jquery ajax传递数组给php
写成:var data = {'item[]':item};$.post(url,data,function(return_data)写成item:item会导致数据缺失。更多:http://www.cnblogs.com/ini_always/archive/2011/12/17/2291290....
分类:Web程序   时间:2014-08-05 00:30:38    阅读次数:426
js添加确认删除操作注意事项
1 function delsure(){2 if(confirm('确认删除吗?')){3 return true;//点击确定则返回这里的内容4 }else{5 return false;6 }7 }在表单中添加onsubmit="retu...
分类:Web程序   时间:2014-08-05 00:29:28    阅读次数:237
[LeetCode] Remove Duplicates from Sorted Array II
Follow up for "Remove Duplicates": What if duplicates are allowed at most twice?For example, Given sorted array A = [1,1,1,2,2,3],Your function should...
分类:其他好文   时间:2014-08-05 00:24:38    阅读次数:281
Javascript单例模式
1.简单单例模式:只能实例化一次的对象也就可以使用“对象字面量”的定义方式来实现:var singleton = { attribute:'', method:function(){}}这样定义的对象,不能使用new singleton的方式来生成另外的对象(不存在prototype和const.....
分类:编程语言   时间:2014-08-05 00:03:58    阅读次数:288
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!