jquery-2.0.3.js版本源码分析 (function(){ (21,94) 定义了一些变量和函数 jQuery = function(){}; (96,283) 给JQ对象,添加一些方法和属性 (285,347) extend : JQ的继承方法 (349,817) jQuery.exte ...
分类:
Web程序 时间:
2016-07-05 18:47:04
阅读次数:
172
//common.js
window.onload=function()
{
vard=document.getElementById(‘wz‘);//通过id获取div节点对象
varnow=newDate();varhour=now.getHours();
vars=newArray();
s[0]="夜间";s[1]="凌晨";s[2]="早间";s[3]="上午";s[4]="午间";s[5]="下午";s[6]="傍晚";s[7]="晚间";s[8]=..
分类:
其他好文 时间:
2016-07-05 15:45:22
阅读次数:
170
在web开发中,避免不了字符串连接的操作,但字符串的连接操作性能高吗?之前有不少文章说使用加号性能地下,建议使用数组的join操作。测试代码:var length = 300000;
/*数组的 join*/
function Test1() {
var date1 = new Date().getTime();
var t = [];...
分类:
其他好文 时间:
2016-07-05 15:43:09
阅读次数:
186
一直都没太明白apply()与call()的具体使用原理,今日闲来无事,决定好好研究一番。 JavaScript中的每一个Function对象都有一个apply()方法和一个call()方法,它们的语法分别为: 它们各自的定义: apply:应用某一对象的一个方法,用另一个对象替换当前对象。例如:B ...
分类:
移动开发 时间:
2016-07-05 15:39:29
阅读次数:
173
jQuery获取Select元素,并选择的Text和Value: 1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发 2. var checkText=$("#select_id").find("opt ...
分类:
Web程序 时间:
2016-07-05 14:20:56
阅读次数:
160
1.整个页面所有的右击事件 document.oncontextmenu = function(){ return false; } 2.特定的区域 document.getElementById("test").oncontextmenu = function(e){ return false; ...
分类:
Web程序 时间:
2016-07-05 14:02:46
阅读次数:
149
Helpers\GeoCode This function connects to google maps and retrieves the lat/lon of the address provided GeoCode::getLngLat(['Hessle Road', 'Hull']) Re ...
分类:
其他好文 时间:
2016-07-05 14:02:38
阅读次数:
103
Helpers\Tags The tags helper is a collection of useful methods: Tags::clean($data) Clean function to convert data into an array. Tags::get($string) Th ...
分类:
其他好文 时间:
2016-07-05 13:57:16
阅读次数:
130
页面滚动到底部自动 Ajax 获取文章 var _timer = {};function delay_till_last(id, fn, wait) { if (_timer[id]) { window.clearTimeout(_timer[id]); delete _timer[id]; } r ...
分类:
Web程序 时间:
2016-07-05 13:44:06
阅读次数:
174
1.每个函数都是Function类型的,和其他引用类型一样都具有属性和方法。函数也是对象,因此函数实际上是一个指向函数对象的指针。 函数声明语法定义: 方法1: function sum(num1,num2){ return num1+num2; } 方法2: 和下面使用函数表达式定义函数的方式几乎 ...
分类:
其他好文 时间:
2016-07-05 12:10:50
阅读次数:
142