Hi Michael Paul
Thanks for your replies - both expressions work !
(plus another I worked on prior to your responses).
Just have to say thanks for the great jquery community support
offerred here
While I have your attention - had another question to ask
Since I am translating the standard
I like Paul's solution better than mine. It's cleaner to attach an event
handler rather than rewrite the href attribute.
Does your page have a large number of a tags, or just a few? If there are
a lot of them and the jQuery code slows the page load down, you could use
event delegation to fix
Hi Michael,
Thanks for the pointers - no -- the treatment of rel attribute on a
tags
is limited - so I guess it will be OK - i run the code on Ajax
success event -
- again thanks much !
Hi,
Rather than replace the href in the source code you could add a click
handler to call your JavaScript function.
A bit like this:
$(function(){
$('a[rel=paginate]').click(function(){
ajax_getPage($(this).attr(href).split(=)[1]);
return false;
});
});
Paul
On Oct 12, 10:56 pm,
I think it would go something like this (thoroughly untested):
$(function() {
$('a[rel=paginate]').each( function() {
this.href = this.href.replace(
/^.*aid=(.+)$/,
javascript:ajax_getPage('$1')
);
});
});
-Mike
5 matches
Mail list logo