javascript&ajax
文章平均质量分 51
kaqi072821
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
javascript 学习资料from 80x86
http://www.80x86.cn/article.asp?id=1556原创 2008-09-07 21:07:15 · 106 阅读 · 0 评论 -
javascript 'this'
1. Scope of this in objects: var b = {a:outerFunc, b:"b"}function outerFunc(base) { var outer=this; var punc="!"; function returnString(ext) { //console.log(this===oute...原创 2011-11-09 22:52:11 · 109 阅读 · 0 评论 -
How to use the data retrieved from ajax?
Whenever you want to use the data retrieved from ajax, you must use it in the callback function which is triggered when the ajax call receives the response. This is a common practice. But if t...原创 2011-11-10 20:59:56 · 125 阅读 · 0 评论 -
Angular js scope: the child scope would inherit from the parent scope
http://docs.angularjs.org/#!/cookbook/deeplinking Learn from this example, the child controller would inherit the function and properties from the parent controller. The "person" attribute i...原创 2011-11-15 23:02:27 · 133 阅读 · 0 评论 -
angular js: angular.bind example
angular.bind api doc see: http://docs.angularjs.org/#!/api/angular.bind var Func = function(a){this.a=a;}var obj=new Func(1);var fun=angular.bind(obj, function(i,j){alert(this.a+i+j)...原创 2011-11-16 16:07:05 · 113 阅读 · 0 评论 -
angular js: filter vs format
Filter transform the model to the display in view.Formatter transform the display in view to model. Filter <input type="text" name="objTxt" value="{a:1, b:[]}" ng:eval="obj = $ev...原创 2011-11-16 21:13:15 · 111 阅读 · 0 评论 -
<<javascript:the good part>>javascript variable scope
The scope of variable declared use 'var' is within the function(including the subfunction which can access its closure) var my=function(){function inner(){console.log(a);//a is declared in the...原创 2011-11-26 22:59:37 · 104 阅读 · 0 评论 -
Angularjs memory leak in ie8 test
Attached is the code to show the memory leak in ie8 for angularjs. 1. performance.html is for angularjs. Keep refreshing by pressing f5 would see a dramatically memory rise.2. performance2.html ...原创 2012-02-02 23:12:11 · 138 阅读 · 0 评论 -
<<javascript:the good part>> prototype, closure, module example
Function.prototype.method=function(name, func){this.prototype[name]=func; // use prototype to add a functionreturn this;}String.method("ping",function(content){ // add method to Stringvar ...原创 2011-12-03 11:51:43 · 127 阅读 · 0 评论 -
<<javascript:the good part>> Inheritance
Javascript does not have the concept of class. It is a prototyal language which means objects inherits directly from other projects.The book introduces several ways to implement the inheritance.1....原创 2011-12-03 15:49:15 · 123 阅读 · 0 评论 -
javascript 'this' , with prototype, closure
just give an examplefunction Controller(){}Controller.prototype=(function(){var p1=function(){console.log(this);};var p2=function(){console.log("in p2");};return {//create an...原创 2011-12-07 22:13:18 · 121 阅读 · 0 评论 -
angular 0.9.19 update to 0.10.5
$eval()==>$digest()$updateView()==>$apply() which will cause $root.$digest()$onEval(function(){})==>$watch(function(){})原创 2012-03-05 22:23:33 · 110 阅读 · 0 评论 -
Nested Function, Function Closure
function outerFunc(base) { var punc="!"; function returnString(ext) { return base + ext + punc; } return returnString;}var baseString = outerFunc("Hello ");...原创 2011-11-09 22:47:21 · 102 阅读 · 0 评论 -
The ways to define a javascript function
1. Declarative Function/*The syntax:function functionname(param1, param2,param3,...,paramn){ finction statements}or var functionname = function (param1, param2,param3,...,...原创 2011-11-09 22:05:12 · 130 阅读 · 0 评论 -
struts下实现ajax的实例
http://www.it-eye.nl/weblog/2005/12/13/ajax-in-struts-implementing-dependend-select-boxes/script script:<script language="javascript"> var req; /* * Get the second options by calling ...原创 2008-09-07 21:11:21 · 119 阅读 · 0 评论 -
IE下JS调试工具
http://www.cnitblog.com/yemoo/archive/2007/10/22/35190.html 做web开发的朋友都清楚,js程序的调试是相当郁闷的,因为首先这种语言语法比较灵活,它是一种弱类型的脚本语言,很多错误是无法控制的,这些不谈,最痛苦的是没有什么好的调试工具,现在的情况比以前稍好,在Firefox下还有firebug,这的确是一个不错的js调试工具,...原创 2009-08-19 13:54:54 · 352 阅读 · 0 评论 -
javascript waitfor function
Javascript has many asynchronous functions. Sometimes, we need to wait until the asynchronous function returns than go on. Following give an sample function for waitforwaitfor = function(){ var...原创 2011-12-12 20:05:57 · 786 阅读 · 0 评论 -
javascript difference between == and ===
JavaScript has both strict and type-converting equality comparison. For strict equality the objects being compared must have the same type and:Two strings are strictly equal when they ha...原创 2011-11-03 23:25:28 · 149 阅读 · 0 评论 -
slice a javascript funtion arguments
[1,2,3].slice(1)//[2, 3]function t(){//arguments.slice(1);//won't work. Can not directly slice the arguments. You can think it is not an arrayvar b=[].slice.call(arguments,1);console.log(b);...原创 2011-12-24 16:08:07 · 135 阅读 · 0 评论 -
<<javascript the good parts>> variable scope
Javascript does not have block scope, but it does have function scope. A variable defined anywhere within a function is visible everywhere within the function. function foo(){ console.log("a:"...原创 2012-01-05 22:22:36 · 125 阅读 · 0 评论 -
load next page automatically while scrolling to the bottom
$(window).scroll(function() { if ($(window).scrollTop() > ($(document).height() - $(window).height() - 3) && me.isFetchAutomatically()) { me.fetchNextMon...原创 2012-01-08 15:39:15 · 140 阅读 · 0 评论 -
javascript: string.format
String.prototype.format = function () { var formatted = this; for (var i = 0; i < arguments.length; i++) { var regexp = new RegExp('\\{' + i + '\\}', 'gi'); formatted = ...原创 2012-01-08 18:31:18 · 103 阅读 · 0 评论 -
How to bind a method to an object from angularjs source code
function bind(self, fn) { var slice = [].slice; var curryArgs = arguments.length > 2 ? slice.call(arguments, 2, arguments.length) : []; if (typeof fn == "function" &...原创 2012-01-14 15:35:18 · 114 阅读 · 0 评论 -
JS regular expression examples from <<good parts>>
//parse_url/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$///ignore case, the other two flags are 'g', 'm'/^abc$/i"into".match(/in|int/)...原创 2012-01-15 21:47:56 · 277 阅读 · 0 评论 -
Javascript function and object
1. javascript use function to define type, and use function to initialize an object. But remember javascript has no concept of Class in most object oriented languages.2. public and private field...原创 2011-11-07 23:04:12 · 131 阅读 · 0 评论 -
javascript HTML encode
_htmlEncode: function (value){ return $('<div/>').text(value).html(); }原创 2013-04-22 10:44:19 · 145 阅读 · 0 评论
分享