JHC3 – Programming Notes

August 17, 2007

JavaScript: Notes from 010411

Filed under: ASP.NET — navaan @ 11:05 am

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

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Silver is the New Black. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.