Page Opening with Multiple AlertsA script that will bring up multiple alerts when someone enters your Web page. It is set up for three alerts.Script CodeGrab a copy of the file below and place it in the same directory as the Web page on which you will use the script (if you wish to place the script file in a different directory you will need to make the necessary adjustments to the src attribute of the script tag that calls it).The code below should be placed between the <head> and </head> tags or between the <body> and </body> tags (probably near the opening <body> tag). ExampleA working sample of the script is shown below. Click the link to get the page with the alert.OptionsYou can change the text of the alerts by opening the salert5.js file and editing the bold (strong) text on the following lines of code:
window.alert('Welcome to my Web Site!'); Additional alerts can be added by adding additional window.alert statements:
window.alert('Welcome to my Web Site!'); If you need to use single or double quotation marks within a quote, you should write them with a backslash before them (i.e. \" and \') in order to avoid JavaScript errors. AccessibilityThis could possibly be made accessible by repeating the information in the alerts someplace on the actual Web page. It would be redundant, but would provide the content for viewers with JavaScript off.It should be noted that this script can be quite irritating and probably should be avoided by professional sites unless absolutely necessary. |