The $().attr("attribute name") function will return the String value
of the given attribute, you can not perform jQuery functions on a
String. To do what your doing, you could try using a regular
expression:

var link = "/local/path"+/^[^?]+\?(.*)$/.exec($(this).attr("href"))[1];
console.log(link);

I haven't tested it, but that will capture everything AFTER the first
question mark in href and append it to "/local/path".

- jake

On 2/13/07, Will <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to covert some links from pico search on a site into local links.
>
>
> I tried
> $(".prevnextbutton").each(function () {
>     $(this).attr("href").replace("
> http://www.picosearch.com/cgi-bin/ts.pl?","/local/path";)
> });
> I get this error: $(this).attr("href") has no properties
>
>
> and then I tried:
> $(".prevnextbutton").each(function () {
>    link = $(this).attr("href");
>    link =
> link.replace("http://www.picosearch.com/cgi-bin/ts.pl?
> ","/local/path");
> console.log(link);
>
> and I keep getting the error "link has no properties"
>
> I feel like this is fairly obvious but I can't for the life of me get it!
>
> Thanks for any help,
> Will
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>
>

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to