This seems to work:
$('a').each(function() {
$(this).attr('href','path/to/' + RegExp("[^#]+$").exec($(this).attr
('href')) + '.html');
});
On Mar 15, 7:03 pm, Jonny Stephens wrote:
> Oops. Wrote too soon.
>
> Works fine for a single anchor. With multiples, all receive the same
> href value
Oops. Wrote too soon.
Works fine for a single anchor. With multiples, all receive the same
href value as the first.
Needs an .each() somewhere?
On Mar 15, 5:44 pm, Jonny Stephens wrote:
> Thanks Brad, that's perfect!
>
> Jonny
>
> On Mar 15, 5:29 pm, Brad wrote:
>
> > There is probably a more
Thanks Brad, that's perfect!
Jonny
On Mar 15, 5:29 pm, Brad wrote:
> There is probably a more concise way to do this, but I'll break down
> the steps
>
> // regular expression pattern to get the hash value
> var patt = new RegExp("[^#]+$");
>
> // The href of your attribute. This is a generic e
There is probably a more concise way to do this, but I'll break down
the steps
// regular expression pattern to get the hash value
var patt = new RegExp("[^#]+$");
// The href of your attribute. This is a generic example, you will
// probably need to provide a more specific jQuery selector to ge
4 matches
Mail list logo