Always start with;
<script language="javascript">
<!--
//code here
-->
</script>
<script language="javascript">
//Popup Message
window.alert("Message Here");
//Click OK or Cancel Message Box
window.confirm("OK or Cancel Message Here");
//Prompt User for Input
window.prompt("Input Vars");
//Creates a Function called calc
function calc(i) {
//Sets x to what the user types in
var x=window.prompt("Enter Number");
//Shows what the User Just Typed In
window.alert("You Entered: " + x);
//Prints to the Screen (VBScript = Response.Write)
document.write(i);
}
calc("Test Message");
</script>
Call a function when the page loads;
//In the BODY tag enter the function like so <body onload="calc();">
Advertisement