Lecture 8 - jsadvanced

Lecture 8 - jsadvanced - Lecture JavaScript Advanced...

Info iconThis preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
JS Advanced Copyright Ellis Horowitz 1998-2009 1 Lecture JavaScript Advanced
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JS Advanced Testing the Speed of Your JavaScript (2009) Copyright Ellis Horowitz 1998-2009 2 Firefox, v 3.0 5103ms Safari v 3.2 6202ms I.E. 7.0 45,928ms
Background image of page 2
JS Advanced Testing the Speed of Your JavaScript Copyright Ellis Horowitz 1998-2009 3 Firefox, v 3.6 772 ms Safari v 4.0 408 ms Chrome v 4.0 396 ms
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JS Advanced Copyright Ellis Horowitz 1998-2009 4 JavaScript Object Hierarchy self, window, parent, top plugins[ ] navigator mimetypes[ ] frames[ ] location forms[ ] elements[ ] Current Window history anchors[ ] buttons checkboxes document links[ ] fileUpload hidden packages images[ ] password radio applets[ ] reset select options embeds[ ] submit Java packages text JavaClass objects textarea
Background image of page 4
JS Advanced Copyright Ellis Horowitz 1998-2009 5 http://www.comptechdoc.org/independent/web/cgi/javamanual/javaobjheir.html
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JS Advanced Copyright Ellis Horowitz 1998-2009 6 Important Objects Window object represents a browser window or frame. This is the top level object for each document, location, and history object Properties of the Window object include: Frame object Location object history object • Document object is responsible for all content on a page, containing all the user interface elements of a page
Background image of page 6
JS Advanced Copyright Ellis Horowitz 1998-2009 7 Examples Using the window Object •To create a new window that shows only the toolbar and status bar and is resizable window.open(“newURL”, “New Window”, “toolbar,status,resizable”) •The height and width defaults are the same as the browser •A new window is positioned in the upper left hand corner of the screen •A call to window.open() returns a value of the new window’s object; this should always be assigned to a variable, e.g. newWindow = window.open(““,””) if (newWindow != null) { newWindow.document.write(“<HTML><HEAD> <TITLE>Hi</TITLE></HEAD>”) }
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JS Advanced Copyright Ellis Horowitz 1998-2009 8 Examples of Document Object Properties Property Value document.title "My Home Page" document.fgColor #000000 document.bgColor #ffffff Some examples: 1. Load a new page by changing the href attributed location.href=http://www.usc.edu/in.html 2. Write out its URL Document.write(location.href);
Background image of page 8
JS Advanced Copyright Ellis Horowitz 1998-2009 9 Setting Document Object Attributes <HTML><HEAD><TITLE>Using the Document Object</TITLE> <SCRIPT LANGUAGE="JavaScript"> function SetColors() { document.fgColor = "black"; document.bgColor = "white"; } </SCRIPT> </HEAD> <BODY><SCRIPT LANGUAGE="JavaScript"> SetColors() </SCRIPT> <font size=+3>This text is displayed in black<br> <font color=red>This text is displayed in red</font></ font> </BODY></HTML>
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
JS Advanced Copyright Ellis Horowitz 1998-2009 10 Browser Output
Background image of page 10
JS Advanced Copyright Ellis Horowitz 1998-2009 11 Location Object •A reference to the URL of the current document •Properties: hash, host, hostname, top, status, defaultStatus, window •No Methods and no Event Handlers
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/12/2011 for the course CSCI 571 taught by Professor Papa during the Fall '07 term at USC.

Page1 / 80

Lecture 8 - jsadvanced - Lecture JavaScript Advanced...

This preview shows document pages 1 - 12. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online