views:

202

answers:

3

I am attempting to use livequery. I unfortunately am stuck using jquery 1.2.6.

This is my code:

$(document).ready(function() {
    $('a.sort').livequery('click', function(event) {
        alert('hello');
    });
});

If I click ANYWHERE in the document, I get the alert 'hello'.

What exactly is wrong there? Is it some bug with jQ1.2.6 and livequery 1.1.1?

This same question was asked here but the question wasn't clear, and the answer didn't help.

A: 

Use the rel attribute:

$('a[rel*=sort]') 
.livequery('click', function(event) { 
    alert('test'); 
});
Vafello
A: 

Get rid of this: $(document).ready(function() { It is triggered for whole document, rather than requested element.

Vafello
Tried that with 1.1.1, nope.
phazei
+2  A: 

Shucks...

livequery 1.1.1 is NOT compatible with jQuery 1.2.6. It only works with jQuery 1.3+

If you need to use a version < 1.3, then livequery 1.0.3 is the latest one that can be used.

phazei