Take over all links -- except certain class (.not?)
I'm currently taking over any links on the page that begin with "users":
$('a[href^="/users/"]').live('click', function(event) {
...however, thi开发者_如何学Cs is a little greedy. I want to exclude any links to "stuff" that are NOT with the "versions" class. I tried:
$('a[href^="/users/"]').not('div.versions a').live('click', function(event) {
...but this breaks the whole block. My next guess it is breaking because of "live" -- with the way events trickle up.
Any ideas? Is there a better way to do this?
try merging not
in the main selector:
$('a[href^="/users/"]:not(div.versions a)').live('click', function(event) {
Check here as well: .not() with .live() not working, seems to be the same problem.
精彩评论