DOC PREVIEW
USF CS 110 - Javascript

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

JavascriptCS 110 Fall 2007JavascriptThe BROWSER scripting language.Similar syntax to java.History: Netscape created to allow dynamic web pages.Uses: Many, here are a couple: verifying and reacting to user input, updating page without making user wait Javascript tutorial: http://www.w3schools.com/js/js_intro.aspAlert box sample: http://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm<html><head><script type="text/javascript">function disp_confirm(){var r=confirm("Press a button");if (r==true) { document.write("You pressed OK!"); }else { document.write("You pressed Cancel!"); }}</script></head><body><input type="button" onclick="disp_confirm()" value="Display a confirm box" /></body></html>CS 110 Fall 2007Can also put javascript in a file external to the html:<html><head><script src="confirm.js"></script></head><body><input type="button" onclick="disp_confirm()" value="Display a confirm box" /></body></html>confirm.js:function disp_confirm(){var r=confirm("Press a button");if (r==true) { document.write("You pressed OK!"); }else { document.write("You pressed Cancel!"); }}See sample at http://www.cs.usfca.edu/~wolber/jsSamples/confirm2.htmlCS 110 Fall 2007Advanced UsesDOM – Document Object ModelYour program can get at the elements in the html.So, for instance, you can sort a list in different ways. A big data structure representing the html page.AJAX – Asynchronous javascript and xmlCall a server to get data, asynchronously.User doesn’t have to wait for call to web service to completeVacation fun: Write mastermind with html and javascript!Html pageJava scriptExternal Web


View Full Document

USF CS 110 - Javascript

Download Javascript
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Javascript and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Javascript 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?