JavaScript Alerts, JavaScript Tutorial, Global Guide Line Technology.
Forum | Blog |


Basic JavaScript Guide.
 JScript Introduction.            
 JScript Why?                       
 JScript Recognitions.          
 JScript onMouseover.         
 JScript with Buttons.           
 JScript Alerts.
 JScript Variables.               
 JScript Operators.               
 JScript Functions.               
 JScript Prompts.                 
 JScript Conditions.             
 JScript Validations.            
 JScript Confirmation Boxes.
 JScript Browser Detection.  
 JScript Redirection.            
 JScript on Links.                 
 JScript Switch.                    
 JScript Loops.                     
 JScript Events.                    
 JScript Exception Handling.
 JScript Reserve Characters. 
 JScript with Objects.            
 JScript Math Object.           
 JScript using Dates.             
 JScript using String.            
 JScript using Arrays.            
 JScript Operations.              
 JScript Handling Cookies.   
 JScript in Mapping.             
 JScript Time Out.                
 JScript Summary.                

JavaScript Tutorial >> JavaScript Alerts.

     Back             Next     

Now JavaScript Tutorial will teach us that JavaScript alert is a useful little tool to put a message you want every one to see first. Unlike the JavaScript Confirm, the person does not have a choice other than to go on.

Example of JavaScript Alert

<script language="JavaScript">


// please keep these lines on when you copy the source

// made by: -

  alert ("This is a JavaScript Alert Example in JavaScript Tutorial")




The text inside the parentheses will be shown in the JavaScript Alert message. If you want to show a string of literal text, enclose the text in quotes. To display JavaScript Variable values, enter the JavaScript Variable name without quotes. You can also combine JavaScript Variable values and text strings by using the plus (+) sign. For example:

JavaScript Alert Example using JavaScript Variables

function showJavaScriptAlert() {
  var tutorial = "JavaScript Tutorial";
  var topic = "JavaScript Alerts";
  alert('We are reading ' + tutorial + ' and our topic is now ' + topic + '.');

<input type="button" value="Click Here" onClick="showJavaScriptAlert();">

This will create the following button - click it to see the alert:

Remember, text inside quotes will be used literally, text with no quotes is assumed to be a JavaScript Variable.

Browser Capability Guide.

JavaScript is supported by Netscape 2+, Internet Explorer 3+, Opera 3+ and most of the other modern web browsers. Each new version of the main browsers has supported new generations of JavaScript commands, each more complex than the last. JavaScript compatibility can still be a problem, as the language is not as standardized as HTML. but this is being worked on.

     Back             Next     

JavaScript Alert, Confirmation and Prompt Boxes Examples

[ About ] [ Contact ] [ Home ]
[ Links ] [ Site Map ] [ Services ] [ Privacy ]

Copyright 2005 -  2023 All rights reserved. (Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher) 437 visitors are online now