I have a series of pages that are assembled dynamically from various
sources. Before the page is returned to the client, I want to find an
anchor matching a URL that's stored in a var. Then I will change the
class of that anchor.

It's easy enough to do this client-side, but I would much rather do
this server-side. I'm pretty new to ASP scripting, but I'm inclined
to think there's some way to use the DOM to get what I want.

I'd searched this group repeatedly and can't find anything on this
point. I'd sure appreciate any approach to this.

Jeff

Re: server-side editing of HTML via vbscript by Steve

Steve
Tue Nov 02 07:28:24 CST 2004

Jeff Gutsell wrote:

> I have a series of pages that are assembled dynamically from various
> sources. Before the page is returned to the client, I want to find an
> anchor matching a URL that's stored in a var. Then I will change the
> class of that anchor.
>
> It's easy enough to do this client-side, but I would much rather do
> this server-side. I'm pretty new to ASP scripting, but I'm inclined
> to think there's some way to use the DOM to get what I want.

No, the DOM tree is constructed by the client from text sent by the
server. You can't access the client's DOM on the server--it doesn't
exist until after the server-side script has completed and the text
has been sent to the client.

However, you can manipulate the string data on the server before it's
sent to the client. Use normal text manipulation functions to modify
the string.

--
Steve

Morality is not properly the doctrine of how we make ourselves happy,
but how we make ourselves worthy of happiness. -Immanuel Kant