随笔分类 - javascript
摘要:hello http://www.nczonline.net/blog/2009/08/11/timed-array-processing-in-javascript/https://developer.mozilla.org/en-US/doc...
阅读全文
摘要:http://programmers.stackexchange.com/questions/122378/whats-the-point-of-initializing-a-variable-with-the-same-value-twicehttp://stackoverflow.com/questions/8316463/why-assign-this-variable-to-itself-in-this-var-declaration
阅读全文
摘要:var poller = { // number of failed requests failed: 0, // starting interval - 5 seconds interval: 5000, // kicks off the setTimeout init: function(){ setTimeout( $.proxy(this.getData, this), // ensures 'this' is the poller obj inside getData, not the window object ...
阅读全文
摘要:1, embedded resource2, add webresource in assemblyInfo.cs3, add js reference with script managerNote: please pay attension the js file name.
阅读全文
摘要:There are two ways to access a property of an object:Using square bracket notation, for example hero['occupation']Using the dot notation, for example hero.occupation
阅读全文
摘要:JavaScript uses arrays to represent indexed arrays and objects to represent associative arrays. If you want a hash in JavaScript, you use an object.
阅读全文
摘要:Functions are Data This is an important concept that we'll need later on—functions in JavaScript are actually data. This means that the following two ways to define a function are exactly the same:function f(){return 1;}var f = function(){return 1;}Callback Functions Because a function is just l
阅读全文
摘要:All values become true when converted to a boolean, with the exception of the six falsy values:""nullundefined0NaNfalse
阅读全文
摘要:<style> .ui-autocomplete { max-height: 100px; overflow-y: auto; /* prevent horizontal scrollbar */ overflow-x: hidden; /* add padding to account for vertical scrollbar */ padding-right: 20px; } /* IE 6 doesn't support max-height * we use height instead, but this forces the menu to always b
阅读全文
摘要:JavaScript Timers with setTimeout and setInterval
阅读全文
摘要:jQuery UI 版本:1.8.9主要原因是中文輸入時不會觸發原本在autocomplete 榜定的keydown事件。 try this one: //fixed firefox and ie in IME bug jQuery('#searchkey').bind( "input.autocomplete", function(){ $(this).trigger('keydown.autocomplete'); }) 参考:http://groups.google.com/group/jquery-/browse_thread/thread/8f34129edc5da55e
阅读全文
摘要:[代码]link:jQuery UI confirmation dialog and asp.net postbackhttp://www.deviantpoint.com/post/2009/03/12/Using-jQuery-UI-Dialogs-for-confirmation-windows.aspx
阅读全文
摘要:asp.net,javascript,RequiredFieldValidator,DetailsView,CommandField.
为CommandField注册脚本
阅读全文
摘要: 多了.button(),且没有return false;这样窗口就无法停留。 正确的如下:
阅读全文
摘要:服务器端: http://eason26-li.javaeye.com/blog/453842
阅读全文
摘要:可扩展的简易点击展开/关闭效果,分别用原生JavaScript和jQuery实现.使用方法及相关解释,请参见源码.另,授人以鱼,不如授人以渔.我写的只是一个原型,提供一个思路一种方法.注释中我也注明了,如果你想要酷炫的效果,你可以根据自己的实际需求扩展.查看演示: 点此查看DEMO原生JS版本:window.onload=function(){ vardivs=document.getElementsByTagName('div');//找到所有div元素 for(vari=0; idivs.length; i++){ if(divs[i].className!='jsdemo')con
阅读全文
摘要:<script type="text/javascript"> //当前table的父table所在的checkbox function GetParentCheckBox(node) { while (node.tagName != "TABLE") { node = node.parentNode; } while (node.tagName...
阅读全文
摘要:/** 去掉字符串前后空格*/String.prototype.trim = function () { var reExtraSpace = /^\s*(.*?)\s*$/; return this.replace(reExtraSpace, "$1"); };/** 验证日期*/function checkDateTime(input){ input = String(input).trim(...
阅读全文
摘要:We perform a browser detection because IE and Netscape have different event models. The function finally returns false so that the keypress event is cancelled (otherwise a second form submit will be r...
阅读全文