jQuery

由href return false 来看阻止默认事件

Posted by bower on February 09, 2012
javascript / 1 Comment

site de rencontre belge 20 ans 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

source site 很多时候我们都想阻止一个a  link的href跳转,

source <a onclick=”return false;” href=”www.360.cn”>click</a>

enter site Continue reading…

go Tags: ,

jquery ajax callback context changed

Posted by bower on September 22, 2010
javascript / No Comments

http://beerbourbonbacon.com/?niokis=hook-up-3-way-dimmer-switch&424=b2 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

http://www.youngasianescorts.co.uk/?baletos=stockpair-%D8%AD%D8%B3%D8%A7%D8%A8-%D8%AA%D8%AC%D8%B1%D9%8A%D8%A8%D9%8A-%D8%A7%D9%84%D8%AE%D9%8A%D8%A7%D8%B1%D8%A7%D8%AA-%D8%A7%D9%84%D8%AB%D9%86%D8%A7%D8%A6%D9%8A%D8%A9&d19=3c the context in ajax call back is not the same one I pass in to it, at lease in IE its not, I think it just been cloned
since I got the problem in IE, and I debug it for 2 hours and find the problem.

opcje binarne a podatki Continue reading…

go to site Tags:

jquery bind 改变context this指向

Posted by bower on September 18, 2010
javascript, / No Comments

agencias matrimoniales madrid opiniones 分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

rencontres sauvages exposition myObject = function(){
this.clicked = false;

frauen treffen kitzbühel

}
myObject.prototype.click = function(e){
this.clicked = true;
var dom = e.target
}
var myOinstance = new myObject()
$('#myid').bind('click',myOinstance.click);

以上代码OO思想意图不会被实现 ,因为myOinstance.click中的this指向$(‘#myid’)的dom元素,而不是myOinstance
很可惜目前jquery不提供更改this指向或改变context的bind方法,我们要自己做一个扩展。

Continue reading…

Tags:

jQuery: Understanding the “chain”

Posted by bower on March 16, 2010
javascript / No Comments

分享给你的朋友->bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

jQuery: Understanding the “chain”
Categories: Source Code, JavaScript, jQuery

Yesterday I was writing some jQuery code and I thought I came across a bug—until I realized it was a bug in my way of thinking and not with jQuery.

Continue reading…

Tags: ,