JavaScript Window Actions

From JumbaWiki

Jump to: navigation, search

JavaScript for window actions can be called through the body onLoad() function or through an <a href...></a> HTML tag.

Note: These scripts can also be written as functions within the standard script tag:

  <script language="Javascript">//YOUR CODE HERE</script>

Contents

Close a window

When you click on this text link the window will close:

  <a href="javascript:window.close()">Close Window</a>

Move window to a point

This link makes the window move to a specified location:

  <a href="javascript:self.moveTo(0,0);">Move window to top left</a>

Resize browser window

  <a href="javascript:window.resizeTo(800,600);">800x600</a>
  <a href="javascript:window.resizeTo(1024,768);">1024x768</a>

Pop-up window

See also

Personal tools
Australian Photographs | Unique Views of Reality | Daedalus