Hi, thanks for the reply.

I tried your code inside the function but it didn't work unfortunately. 

This is the actual site with the links I'm trying to convert:
http://forums.whirlpool.net.au/forum-replies.cfm?t=661554
I'm hoping to make a greasemonkey script since the site already uses the
jQuery library.

BTW, with my previous attempt, you said that the "each" function returns the
raw DOM, but doesn't the "text" function access the text inside the node (in
this case the span tag)?

Thanks for your help so far, I've been trying to figure this out by myself
all night. :)


Karl Rudd wrote:
> 
> You almost have it. The "each" function actually returns the "raw" DOM
> element so to use jQuery you'll need to "enclose" this.
> 
> Just replace the core with:
> 
> var $this = $(this);
> $this.html( $this.html().replace(/index.cfm?a=wiki&tag=/gi, "") );
> 
> Karl Rudd
> 
> On 2/28/07, Yansky <[EMAIL PROTECTED]> wrote:
>>
>> I have many of the following type of links on a page:
>> < a
>> href="htp://foo.com/index.cfm?a=wiki&tag=abc"><span>htp://foo.com/index.cfm?a=wiki&tag=abc</span>
>>
>> I'm trying to remove the text in between the span tags so that only the
>> text
>> after http://foo.com/index.cfm?a=wiki&tag= is showing. I have tried the
>> following, but it doesn't seem to work.
>>
>> $('a > span').contains('index.cfm?a=wiki&tag=').each(function(i){
>>   this.text().replace(/index.cfm?a=wiki&tag=/gi, "");
>> });
>>
>> Can anyone point me in the right direction?
>> Cheers.
>> --
>> View this message in context:
>> http://www.nabble.com/Replace-text-in-array-tf3308186.html#a9201977
>> Sent from the JQuery mailing list archive at Nabble.com.
>>
>>
>> _______________________________________________
>> jQuery mailing list
>> discuss@jquery.com
>> http://jquery.com/discuss/
>>
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Replace-text-in-array-tf3308186.html#a9202631
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to