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: - https://www.GlobalGuideLine.com
alert ("This is a JavaScript Alert Example in JavaScript Tutorial")
//-->
</script>
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 + '.');
}
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.