11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<br />

<br />

<br />

X: <br />

Y: <br />

<br />

<br />

<br />

<br />

<br />

Setting Window Location<br />

It is often desirable to set a window to a particular URL. <strong>The</strong>re are numerous ways to do this in<br />

<strong>JavaScript</strong>, but the best way is to use the Location object that is within Window. <strong>The</strong> Location<br />

object is used to access the current location (the URL) of the window. <strong>The</strong> Location object can<br />

be both read and replaced, so it is possible to update the location of a page through scripting.<br />

<strong>The</strong> following example shows how a simple button click can cause a page to load.<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!