Alerts


This tutorial will teach you the basics of javascript alerts and how usefull they really can be.

The basic command for a javascript alert is:

JavaScript Code
  1. alert('your choice of text')


Say you wanted and alert to pop-up when someone click's a link? Well easily done just use the following code:

JavaScript Code
  1. <A HREF="alert('Alert!')">Alert!</A>


You can spice up the links about by adding some conditions do it, the following code will make the alert pop-up on a mouseover:

JavaScript Code
  1. <A HREF="noplace" onMouseover="alert('Alert!')">Alert!</A>


So there you have it, the basics of the alert command in javascript this can be used in many usefull ways and can be a site greeter.

Craig.
Craig's Avatar
Author:
Views:
2,247
Rating:
Posted on Friday 4th April 2008 at 09:04 PM
DanielXP
DanielXP's Avatar
just like any one could dos any site
Posted on Friday 4th April 2008 at 08:33 PM
Diablosblizz
Diablosblizz's Avatar
Dark, I would advice that you NEVER put your IP on any website. I can now take your IP and do a HTTP DOS on it. Not saying that I would, but I would advice that you shouldn't.
Posted on Friday 4th April 2008 at 06:17 PM
darklight19
darklight19's Avatar
https://76.98.141.11/tools/javascriptpromt/index.php
Posted on Friday 4th April 2008 at 05:45 PM
darklight19
darklight19's Avatar
Hold on. kthx, i will PM you when I'm done typing up the thing
Posted on Friday 4th April 2008 at 05:35 PM
Dalez
Dalez's Avatar
So where do i put that? and do i have to make my own text box?
Posted on Friday 4th April 2008 at 05:31 PM
darklight19
darklight19's Avatar
<script type="text/javascript">
function prompter() {
var reply = prompt("Hey there, good looking stranger! What's your name?", "")
return reply
}
</script>
Posted on Friday 4th April 2008 at 04:09 PM
Dalez
Dalez's Avatar
How would you make it so that you could make an alert to sed to your users on your website? Like going into the admin panel, and then putting the text into a box, press send and then every one on my site gets it?

Thank