开发者

Preventing jQuery click() conflicts

开发者 https://www.devze.com 2022-12-17 01:32 出处:网络
I have a table of locations. Each location has a individual url associated with it. I am using one column to activate / deactivate that url so I can turn locations off and on. I\'m using jQuery\'s bin

I have a table of locations. Each location has a individual url associated with it. I am using one column to activate / deactivate that url so I can turn locations off and on. I'm using jQuery's bind /开发者_如何学Go click to do that with an AJAX request.

I now want to make clicking anywhere on that table row take the user to that individual url.

var url="http://mysite.com/"+jQuery(event.target).siblings("td.url").text();
jQuery(location).attr('href', url);

The problem is that it's intercepting my other columns click. Is there a way to say something like:

if(event.target != jQuery("td.active")){ //redirect }


if(!jQuery(event.target).is('.active')) {

is what you want.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号