Cheap Hosting Domain Names

  • Subscribe to our RSS feed.
  • Twitter
  • StumbleUpon
  • Reddit
  • Facebook
  • Digg

Friday, 11 May 2012

Window Object in Javascript: Properties and Methods

Posted on 08:57 by Unknown
1 The Window object is the top level object and represents the window of the browser.

2. Window objects are either the current window (if the browser is displaying only a single document), or those created with a window.open() method (where the name is specified in the code), or separate frames, if the document is laid out using a <FRAMESET> definition (where the windows are named in the <FRAME> element).

3. As the Window object is the top level object in the object hierarchy and the existance of the current window is assumed, most Window properties need not be prefixed by Window. For example, the following two references are identical :

window.defaultStatus
defaultStatus

and would both return the default text of the status bar for the current window.

4. Difference between Window and Documnet Objects:

Window is the first thing that gets loaded into the browser. The document object is your html document that will be loaded into the browser. The Document object provides access to all HTML elements in a page, from within a script. The document actually gets loaded inside the window object. The Document object is a part of the Window object, and can be accessed through the window.document property.

Window Objecy Properties

closed: Returns a Boolean value indicating whether a window has been closed or not
defaultStatus: Sets or returns the default text in the statusbar of a window
document: Returns the Document object for the window
frames: Returns an array of all the frames (including iframes) in the current window
history: Returns the History object for the window
innerHeight: Sets or returns the inner height of a window's content area
innerWidth: Sets or returns the inner width of a window's content area
length: Returns the number of frames (including iframes) in a window
location: Returns the Location object for the window
name: Sets or returns the name of a window
navigator: Returns the Navigator object for the window
opener: Returns a reference to the window that created the window
outerHeight: Sets or returns the outer height of a window, including toolbars/scrollbars
outerWidth: Sets or returns the outer width of a window, including toolbars/scrollbars
pageXOffset: Returns the pixels the current document has been scrolled (horizontally) from the upper left corner of the window
pageYOffset: Returns the pixels the current document has been scrolled (vertically) from the upper left corner of the window
parent: Returns the parent window of the current window
screen: Returns the Screen object for the window
screenLeft: Returns the x coordinate of the window relative to the screen
screenTop: Returns the y coordinate of the window relative to the screen
screenX: Returns the x coordinate of the window relative to the screen
screenY: Returns the y coordinate of the window relative to the screen
self: Returns the current window
status: Sets the text in the statusbar of a window
top: Returns the topmost browser window

Window Object Methods

alert(): Displays an alert box with a message and an OK button
blur(): Removes focus from the current window
clearInterval(): Clears a timer set with setInterval()
clearTimeout(): Clears a timer set with setTimeout()
close(): Closes the current window
confirm(): Displays a dialog box with a message and an OK and a Cancel button
createPopup(): Creates a pop-up window
focus(): Sets focus to the current window
moveBy(): Moves a window relative to its current position
moveTo(): Moves a window to the specified position
open(): Opens a new browser window
print(): Prints the content of the current window
prompt(): Displays a dialog box that prompts the visitor for input
resizeBy(): Resizes the window by the specified pixels
resizeTo(): Resizes the window to the specified width and height
scroll(): Scrolls the window
scrollBy(): Scrolls the content by the specified number of pixels
scrollTo(): Scrolls the content to the specified coordinates
setInterval(): Calls a function or evaluates an expression at specified intervals (in milliseconds)
setTimeout(): Calls a function or evaluates an expression after a specified number of milliseconds

Email ThisBlogThis!Share to XShare to Facebook
Posted in Javascript | No comments
Newer Post Older Post Home

0 comments:

Post a Comment

Subscribe to: Post Comments (Atom)

Popular Posts

  • Online Religion Degrees
    Religion plays a major role in the historical, political, and cultural life of our societies. If you are fascinated by belief systems, consi...
  • How to create dynamic tables in HTML using javascript at runtime?
    In this tutorial, you will come to know how to create dynamic tables in HTML. There are some situations when you don't know the contents...
  • Online Economics Degrees
    Economists research and analyze economics, or the way people choose to use their resources to produce goods and services. Economists typical...
  • Online Advertising Degrees
    The objective of any business firm is to market and sell its products or services profitably. In small firms, the owner or chief executive o...
  • Online Geography Degrees
    With the growth of online colleges and universities, geography degrees online have gained immense importance. Geography degrees online can b...
  • Online DBA (Database Administrator) Degrees
    Database managers keep vital information organized.  With a database technology degree, you may find yourself organizing customer informatio...
  • Online Social Science Degrees
    Social science covers a broad range of fields: behavioral science, history, economics, geography, political science, women''s studie...
  • Difference between page_init, page_load and page_prerender events
    page_init This event is the first event to occur when an ASP.NET page is executed. This is the event where you should be performing any init...
  • Online BCA Degrees
    The boom in the IT industry has opened up plenty of job opportunities for computer professionals. As a result, computer application courses ...
  • Online Professional Degrees
    Going back to get more education can be a difficult, time consuming and sometimes impossible proposition. But with new advances in virtual t...

Categories

  • AJAX
  • C++
  • CSS
  • Delphi
  • DOTNET
  • HTML
  • Javascript
  • jQuery
  • Management
  • Online Degrees
  • Oracle
  • Others
  • Phonegap
  • PHP
  • Unix
  • XML

Blog Archive

  • ▼  2012 (180)
    • ►  September (89)
    • ►  August (11)
    • ►  July (4)
    • ►  June (3)
    • ▼  May (25)
      • Positioning Property and Z-Index in CSS
      • Validation Controls in ASP.NET: System.Web.UI.WebC...
      • COM Family: COM+ and DCOM, Interop, RPC and TLB
      • Frameset, Frame and IFrame Elements in HTML
      • List of problems occuring while using html tables
      • Alternative of XML: JSON (JavaScript Object Notation)
      • Basic Points of SOA (Service Oriented Architecture)
      • 11 Commonly used AJAX Frameworks
      • WCF: A SOA based Service Framework
      • WPF (Windows Presentation Foundation): Features
      • Relation between Tablespace, Datafile and Control ...
      • 6 Advantages of using stored procedures in your ap...
      • Window Object in Javascript: Properties and Methods
      • DECODE Function vs CASE Statement in Oracle
      • Oracle Streams: An Overview
      • Network Configuration Files in Oracle
      • 40 Objective Type ASP.NET Interview Questions (Par...
      • SQL Replay: A new feature of Oracle 11g
      • 11 Methods to implement 301 Redirect URLs
      • Partitioned Tables: Types and Advantages
      • ItemDataBound in ASP.NET
      • Protecting E-mail Addresses on Webpages: Beware of...
      • Non Breaking Space vs Zero Width Space in HTML
      • Difference between AJAX and jQuery
      • Preloading Images: A trick to overcome delays in i...
    • ►  April (48)
Powered by Blogger.

About Me

Unknown
View my complete profile