The problem lies in, if you search for at term like "image", then the simple
replace would mess up a line like:

<img scr="./image/picture.jpg">This is a nice image of something..

Would turn into 

<img scr="./<span style="background:#FF0000">image</span>/picture.jpg">This
is a nice <span style="background:#FF0000">image</span> of something..

And that doesn't look nice in any browser..

<thomas/>


> -----Original Message-----
> From: Chris Tifer [mailto:[EMAIL PROTECTED]] 
> Sent: 16. august 2002 22:49
> To: ActiveServerPages
> Subject: Re: Google Highlight
> 
> 
> If you have the text that's going to be output, replace matching
> terms like such (this is VERY simple - it doesn't take into account
> the fact that the term may appear inside a link, etc):
> 
> strText = "your text that will be output"
> 
> Response.Write REPLACE(strText, "your", "<span style=""background:
> #FF0000'"">your</span>")
> 
> Of course, you'd make the word "your" dynamic and probably 
> wouldn't choose
> such an ugly bg color, but you get the point...
> 
> Chris Tifer
> http://www.emailajoke.com
> 
> 
> ----- Original Message -----
> From: "Thomas V. Nielsen" <[EMAIL PROTECTED]>
> To: "ActiveServerPages" <[EMAIL PROTECTED]>
> Sent: Friday, August 16, 2002 10:26 AM
> Subject: Google Highlight
> 
> 
> > Sory for the perhaps OT here, but I have failed to accomplish this
> > serverside.
> >
> > Anyone who use the Google toolbar for IE knows, when you 
> hit the button
> > "Highlight" the words you have searched for, is getting 
> highlighted and
> > easy to spot.
> >
> > You kan do a bit by the same by presseing CTRL+F, which you 
> could trick
> > client-side by some javascript.
> >
> > But how can I do something similar - that is to highligt 
> some text on a
> > webpage?
> >
> > </thomas>
> >

---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to