he scope of all functions is window. (The reason why is you are invoking f as a function(类,全局的类) and not a method. When invoked as a function this is ...
分类:
编程语言 时间:
2016-09-25 20:25:22
阅读次数:
182
Function bind() and currying <%-- All JavaScript functions have a method called bind that binds to an object and returns a new function. The first arg ...
分类:
编程语言 时间:
2016-09-25 18:50:15
阅读次数:
188
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"><head> <title></title> <script type="text/javascript"> //定义函数 function isLeapYear(year) { / ...
分类:
其他好文 时间:
2016-09-25 17:24:37
阅读次数:
172
function timestamp(time){ var date = new Date(time); //传个时间戳过去就可以了 Y = date.getFullYear() + '-'; M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) ...
分类:
其他好文 时间:
2016-09-25 17:24:35
阅读次数:
105
[javascript] view plain copy print?在CODE上查看代码片派生到我的代码片 jQuery.ajax({ url: path, type: "POST", dataType:'json', data:{word : 'a'}, success:function(jso ...
分类:
Web程序 时间:
2016-09-25 17:24:28
阅读次数:
168
//获取url中的参数 /*var url = window.location.search; function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达 ...
分类:
Web程序 时间:
2016-09-25 17:16:31
阅读次数:
156
<script> function fresh() { if(location.href.indexOf("?reload=true")<0) { location.href+="?reload=true"; } } setTimeout("fresh()",300); document.onkey ...
分类:
其他好文 时间:
2016-09-25 17:14:09
阅读次数:
125
.html()方法 获取集合中第一个匹配元素的HTML内容 或 设置每一个匹配元素的html内容,具体有3种用法: 3..html( function(index, oldhtml) ) 用来返回设置HTML内容的一个函数 .text()方法 得到匹配元素集合中每个元素的文本内容结合,包括他们的后代 ...
分类:
其他好文 时间:
2016-09-25 16:02:37
阅读次数:
148
AngularJs的指令定义大致如下 angular.module("app",[]).directive("directiveName",function(){ })其中return返回的对象包含很多参数,下面一一说明 你知道用AngularJs怎么定义指令吗? 1.restrict (字符串)可 ...
分类:
Web程序 时间:
2016-09-25 15:59:34
阅读次数:
263
本文是翻译Function.apply and Function.call in JavaScript,希望对大家有所帮助 转自“http://www.jb51.net/article/52416.htm” 第一次翻译技术文章,见笑了! 翻译原文: Function.apply and Functi ...
分类:
移动开发 时间:
2016-09-25 15:48:19
阅读次数:
175