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, jsw_nz <[EMAIL PROTECTED]> wrote: > Just needing some pointers on jQuery string manipulation > > I have a content management system > - in which I am applying experimental (jQuery) ajax functions - these > work OK - ! > > But ather than hack the CMS source code, > I want to create a function that replaces the standard hrefs that the > CMS generates > > >> with javascript functions, which are triggered on Ajax success event > > basically here are the translation requirements: > > TRANSLATE > FROM > <a rel="paginate" href="index.php?aid=1-2">content</a> > > TO > <a href="javascript:ajax_getPage('1-2')">content</a> > > guessing it is a matter of getting the hrefs, based on rel="paginate" > as a selector; > then replacing with the javascript string, where the key variable is > aid, ie "1-2" in this case... > > I have tried getting this to work, but am having problems > so wanted to ask if any more experience jQuery programmers might > provide pointers > > thanks is advance.