473,394 Members | 1,759 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

ASP as a preposessor?

Hi. I was wondering if someone here could help. I have a simple javascript client-side web site. On many sites, you see a little 'new' or 'updated' icon after recently modified hyperlinks. To simulate this feature, my html pages add code such as <a href="home.htm">Home<span class="updated"></span></a>. When such a page loads, it has onload=js code that checks all the spans.getAttribute("href") references. With an array of page names/dates (from an external js file) if a link < 90 days and has a <span class='new'>, I do a spans.innerHTML = "<img src='new.gif'>".

I want to redo this logic. With my array of page names/dates I could just check all the <a href> links on a page, appending the <img src> to each innerHTML that has a link < 90 days old (I could also do something with the arrays to let the code whether the href is 'new' or 'updated'). This would avoid having to add <span> code to the html page. Of course I still need to onload=js code, but I was thinking. Could I do an asp script as a preprocessor?

My web site is framed. If I call home.htm from the frame main, is it possbile to execute an asp script that would read the file home.htm, add the little 'new' and 'updated' icons, then deliver the final home.htm page?

Any advice would be greatly appreciated...Dennis

Jul 23 '05 #1
1 1007
Dennis Allen wrote:
Hi. I was wondering if someone here could help.
I have a simple javascript client-side web site.
On many sites, you see a little 'new' or 'updated'
icon after recently modified hyperlinks. To simulate
this feature, my html pages add code such as <a
href="home.htm">Home<span class="updated"></span></a>.
When such a page loads, it has onload=js code that
checks all the spans.getAttribute("href") references.
With an array of page names/dates (from an external
js file) if a link < 90 days and has a <span class='new'>,
I do a spans.innerHTML = "<img src='new.gif'>".
Why all the client-side scripting if you have ASP available?
I want to redo this logic.
As you should.*NEVER* rely on client-side scripting for a basic
functionality of your site. Especially not when you have server-side
scripting available.

With my array of page names/dates I could just check all the
<a href> links on a page, appending the <img src> to each
innerHTML that has a link < 90 days old (I could also do
something with the arrays to let the code whether the href
is 'new' or 'updated'). This would avoid having to add
<span> code to the html page. Of course I still need to
onload=js code, but I was thinking. Could I do an asp
script as a preprocessor?
Have ASP do every bit of it. If you have code in the page that marks
"old" or "new" links, then have ASP search and replace that code with
the code you want.
My web site is framed. If I call home.htm from the frame main,
is it possbile to execute an asp script that would read the file
home.htm, add the little 'new' and 'updated' icons, then deliver
the final home.htm page?
Sure. Ask in an ASP group.
Any advice would be greatly appreciated...Dennis


Fix your software.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.