JavaScript Alert BoxThis JavaScript Alert Box code enables you to display messages such as warnings in their windows or can be used as a confirm box. You can add additional messages in the display message confirmation box and have it talk to them with their name etc.This script works in Internet Explorer, Google Chrome, Firefox and Netscape.
<html> <head> <title>Simple Alert Box</title> <script language="JavaScript"> <!-- START ALERT BOX SCRIPT --> <!-- This script is courtesy of JavaScript and More. www.javascriptsandmore.com --> <!-- JavaScript and More is your source for javaScript! --> <!-- This part of the script goes between your HEAD tags. --> <!-- Hide the script from old browsers -- function loadalert () <!-- This is where you write your message. Just change the text between the double quotes. --> {alert("JavaScript's and More Thanks you for visiting our website :)") } // --End Hiding Here --> </script> </head> <!-- This part of the script goes INSIDE your FIRST BODY TAG --> <body onLoad="loadalert()"> <!-- END ALERT BOX SCRIPT --> </body> </html> Simple-simon stuff, huh? Bet you never thought it could be so easy... Now let's take it one step further. Let's have a conversation with the new visitor and then write his name in a personalized message write on the web page he's visiting. In the <head> <SCRIPT language="JavaScript"> <!-- var name = prompt('What is your name, please?', 'Web Designer'); var today = new Date(); var hrs = today.getHours(); if (hrs < 5) alert('Good Morning, '+name+', it sure is early !'); else if (hrs < 12) alert('Good Morning, '+name+' '); else if (hrs <= 18) alert('Good Afternoon, '+name+' '); else if (hrs < 24) alert('Good Evening, '+name+' '); //--> </SCRIPT> And in the <body> <SCRIPT language="JavaScript"> <!------hide document.write("<CENTER><H3>Hello, " + name + " ! Have you ever tried to install a cool script into your web page? <\/H3><\/CENTER>"); //-------> </SCRIPT> Click on link to see how alertbox works ![]()
Additional Info:
It is so pleasant to work with experts. Click here to find out more regarding web design london.
Category-AlertsTags- JavaScript Alert Box
java script alert box alert box in JavaScript alert box JavaScript JavaScript alert boxes JavaScript alertbox JavaScript alert message box js alert box |
It is so pleasant to work with experts. click here to find out more regarding sell ads.
|