Categories:

Site Search:


Display a javascript alert box to your visitors

Javascripts allows you to popup a small box of text, rather like the error and information message boxes within windoze.

Click here for an example alert

To make a link that pops up an alert, simply use the code below. Naturally, customise the alert message to suit your purposes. These types of links can be useful for warning a visitor before they visit a particular page, or to ensure they have read terms & conditions. This example uses the onclick event to invoke the alert.

<script language="JavaScript" type="text/javascript">
<a href="#" onclick="javascript:alert('This is a what a javascript alert looks like')">
Click here for an example alert
</a>
</script>

You can also popup an alert whenever a particular page loads, using the script below:

<script language="JavaScript" type="text/javascript">
alert ("This is a what a javascript alert looks like")
</script>

21.02.2007. 17:23

malik said on 05.04.2008. 10:29

it is good scrept can i use it in my site

Andy said on 08.04.2008. 13:32

Yep: use it. modify it, sell it. Basically, it's yours ;)

Questions, comments, insults or praise? Have your say:

:

:

:


5 + 1 =

Page last (manually) updated: May 01, 2007.