Within the <head> tags of your website put the following:
| <head> <script type="text/javascript"> window.status = "Your Message Here"; </script> </head> |
But what if your websurfer doesn't have a web browser that doesn't support javascript, so it displays the script as text? To prevent that, you can simply add <!-- and // --> around the code in the script like so:
| <body> <script type="text/javascript"> <!-- window.status = "Your Message Here"; // --> </script> </body> |
2. Now what if you want the status bar to display information when people rollover your links. Here's an easy trick how to. First, either in the <head> tags or in the <body> tags add your status bar code, but make it a function{ } like so:
| <script language="Javascript"> <!-- /* This is the function used to display the statusbar message when called upon*/ function linkmessage(msg){ window.status = msg || ' '; } // --> </script> |
(note: I didn't put my javascript in the header tags, that's why <!-- and // --> are added.)
The msg || ' '; basically means, the status bar will display the contents of the variable msg, if there aren't any contents it just displays a space (seems link nothing).
3. Now we must add some code to your <a href> links telling them to activate the functions we declared in the javascript.
| <a href="#" onMouseOver="linkmessage('This is the First Link');return true;" onMouseOut="linkmessage();">My First Link</a> <br> <a href="#" onMouseOver="linkmessage('This is the Second Link');return true;" onMouseOut="linkmessage();">My Second Link</a> |
Ok so what does all of this do. Well the onMouse.. code is javascript which I added to the already existing links. So onMouseOver, means when the mouse rolls over the link, it then activates the function we made called 'linkmessage', and the value in the brackets is the message it sends to the 'linkmessage' function. onMouseOut detects when the mouse rolls off a link, therefore it removes the status bar message, replacing it with a blank space. Now return true; was added because your browsers default is to display the path of the link in the status bar. Instead now, return true; tells it to listen to the onMouseOver command. So now your links should work like the following.My First Link
My Second Link
Related Articles
- Prevent Right-clickingIf you dont want your visitors to rightclick at your page, you can insert this code somewhere between and . Type in the message you want your visitors to get in the line Write your message here
- Message Board Security ProblemsSecurity leaks can be a big problem for any site using a message board. Hackers can actually use your message board to go in and change things on your site. This has happened to me at least four times. Once an iframe was added to every single page of one of my very large sites...
- PHP Contact FormFirst, lets create the html section. I made a simple form, but it gets the job done. You can customize it if you want, but remember to use the same form variables.
- Simple Contact FormLearn how to write a clean and easy contact form for your site.
- Add Streaming Audio To Your WebsiteAdding streaming audio to your web site can help you enhance the message you send to your customers and can serve as a wonderful confidence-building tool. In the past, audio was used primarily as a decorative effect, but advances in technology and the increased use of the internet by consumers have ...
- Form Mail via CDONTSASP gives you the power to send mail using the CDONTS mail object. This script will send an email from a user to whichever email address you choose...
- Neon TextDisplays a sentence, changing its colour one letter at a time, from the start colour, to your chosen colour and back again. The script can be modified to change the message, colours and animation change.
- E-mail form using HTML and PHPSometimes its a nice touch to include an e-mail feedback form on your contact page or elsewhere on your web site. Lets create an e-mail form using html and a simple php script to send it along.
- PHP MessageboxEasily create a PHP Message Box, without using any mysql! Using this method, when your visitors post something, the simple script interprets it, and stores the message in a text document. It is also fully customizable with HTML.
- Creating a ShoutboxThis tutorial - Creating a Shoutbox will keep your interest as well as teach you a great bit of design with all the code you will need right on the page. The author makes it a snap with lots of photos and illustrations.
