Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing all links on my site

Status
Not open for further replies.

dwhalen

Programmer
Feb 22, 2002
105
CA
I am using a style sheet for my site. What I want to know is if I can set what the statusbar says for all the links in my site. Currently, they display the various javascript functions that they preform, which is pretty ugly. I know I can change each one individually but I would much rather do it for all the links at once. That way, if my boss changes his mind as to what he wants displayed I only have to do it in one place.

Thanks
 
Use javascript to put a message on the status bar when the page loads:

<script language=&quot;JavaScript&quot;>
<!--
function statusMsg(){
var yourwords = &quot;Thank you for visiting my site!&quot;;
window.status=yourwords;
}
// -->
</script>
Then on your web page:

<body onload=&quot;statusMsg();&quot;> There's always a better way...
 
I am doing something simalar to that. Currently, I use
<body onMouseOver=&quot;window.status='Hello';&quot;>
However, the problem with both yours and my solution is that as soon as the user hovers over a link the javascript function is displayed in the status bar. That is why I am looking for a style sheet solution.

Thanks
 
This might not be the perfect solution either but try this:

Code:
function statusBar()
{
window.status=&quot;Welcome to My Site&quot;;
}

document.onMouseMove=statusBar();
I've never used the onMouseMove before, so there may be reasons why you shouldn't use it. It may use alot of system resources due to the fact that there could be a number of mouse moves per second, not to mention per minute. an alternative would be the following
Code:
function statusBar()
{
windwow.status=&quot;Welcome to My Site&quot;;
window.setTimeout(&quot;statusBar()&quot;,2000);
}
This function will be run every 2 seconds, therefore even if the user hovers over a link, the status bar will still display Welcome to My Site because the function will have run in the meantime.

Good Luck [wavey]
 
I'm pretty sure that CSS so far does not include any way to set the text for the status bar. I can only think of two other ways to solve your problem.

1. (ok) Put <!--#include file=&quot;filename&quot; --> at the top of each page. In the file, include all the code that you want to affect the entire website (javascript, html,asp). It works exactly the same was as actually writting the code that is in the file on each website. This is what I do on my site and it works great. This solution isn't exactly what you want because you will have to go through each page and put the code at the top (unless you write some recursive function to do it) but you will only have to do it once.

2. (bad) I think this idea is not too good but anyway....write some function to recursively update all the pages. I think this method is not good but maybe you are really good at recursion.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top