Javascript Knowledge

  • what is javascript

  • javascript Variable
  • javascript function
  • javascript Event

  • JavaScript If
  • javascript for

  • javascript object
  • Javascript String
  • Javascript Date
  • Javacsript Array
  • Javascript Math

  • Javascript onclick
  • JavaScript onload

  • Javascript Frame
  • Javascript Image
  • Javascript Style
  • Javascript Textarea
  • Javascript Table
  • Javascript window
  • Javascript Location
  • Javacsript form
  • Javascript Checkbox
  • Javascript Input
  • Javascript Radio
  • Javascript Select
  • Javascript Submit

  • Javascript alert
  • Javascript close
  • Javascript confirm
  • Javascript Document open
  • Javascript getElementById
  • Javascript print
  • Javascript reload
  • Javascript remove
  • JavaScript replace
  • Javascript setTimeout
  • JavaScript split
  • JavaScript substring
  • Javascript window open
  • window showmodaldialog

  • Javascript href
  • Javascript IFrame
  • Javascript innerHTML
  • Javascript selectedindex
  • Javascript URL
  • Javascript window Location

  • javascript write to file
  • JavaScript write
  • javascript string to integer
  • Javascript popup
  • Javascript return
  • Javascript Obfuscator
  • Javascript disable
  • Javascript Hide
  • More others

    Javascript
    CSS
    PHP

     

    Javascript Window


    Javascript Window Object

    The Javascript Window object represents the browser window. A Javascript Window object is created automatically with every instance of a <body> or <frame> tag.

    IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard).

    Javascript Window Object Collections

    Collection

    Description

    IE

    F

    N

    W3C

    frames[ ]

    Returns all named frames in the window

    3

    1

    2

     

    Javascript Window Object Objects

    Object

    Description

    IE 

    F

    N

    W3C

    clientInformation

    Contains information about the browser

    4

     

     

     

    clipboardData

     

    5

     

     

     

    document

    This object can be used to access all elements in a page

    3

     

     

     

    event

    Represents the state of an event

    4

     

     

     

    external

     

    4

     

     

     

    history

    Contains the URLs the user has visited within a browser window

    3

     

     

     

    location

    Contains the current URL of the window

    3

     

     

     

    navigator

    Contains information about the client browser

    3

     

     

     

    screen

    Contains information about the client's display screen

    4

     

     

     

    Javascript Window Object Properties

    Property

    Description

    IE 

    F

    N

    W3C

    closed

    Returns a Boolean value that specifies whether the referenced window has been closed

    4

    1

    3

     

    defaultStatus

    Sets or returns the default text in the statusbar of the windows (will be displayed when the page loads)

    3

    1

    2

     

    dialogArguments

    Returns all variables passed into the modal dialog window

    4

     

     

     

    dialogHeight

    Sets or returns the height of the modal dialog window

    4

     

     

     

    dialogLeft

    Sets or returns the left coordinates of the modal dialog window

    4

     

     

     

    dialogTop

    Sets or returns the top coordinates of the modal dialog window

    4

     

     

     

    dialogWidth

    Sets or returns the width of the modal dialog window

    4

     

     

     

    frameElement

    Returns the frame/iframe object that is hosting the window in the parent document

    5

     

     

     

    length

    Sets or returns the number of frames in the window

    4

    1

    6

     

    name

    Sets or returns the name of the window

    3

    1

    2

     

    offscreenBuffering

    Sets or returns a Boolean value that specifies whether the window is drawn offscreen before being visible to the user

    4

     

     

     

    opener

    Sets or returns a reference to the window that created the window

    4

    1

    3

     

    parent

    Returns the parent window

    3

    1

    2

     

    returnValue

    Sets or returns the value returned from the modal dialog window

    4

     

     

     

    screenLeft

    Returns the x-coordinate of the upper left corner of the browser - relative to the upper left corner of the screen

    5

     

     

     

    screenTop

    Returns the y-coordinate of the top corner of the browser - relative to the top corner of the screen

    5

     

     

     

    self

    Returns a reference to the current window

    3

    1

    2

     

    status

    Sets or returns the text in the statusbar of the window

    3

    1

    2

     

    top

    Returns the topmost ancestor window

    3

    1

    2

     

    Javascript Window Object Methods

    Method

    Description

    IE

    F

    N

    W3C

    alert()

    Displays an alert box with a specified message and an OK button

    3

    1

    2

     

    attachEvent("event",pointer)

     

    5

     

     

     

    blur()

    Removes focus from the current window

    4

    1

    3

     

    clearInterval(ID)

    Cancels a timeout that is set with the setInterval() method

    4

    1

    4

     

    clearTimeout(ID)

    Cancels a timeout that is set with the setTimeout() method

    3

    1

    2

     

    close()

    Closes the current window

    3

    1

    2

     

    confirm()

    Displays a dialog box with a specified message and an OK and a Cancel button

    3

    1

    2

     

    createPopup()

    Creates a pop-up window

    5

     

     

     

    execScript("code", "lang")

    Executes a specified script. The arguments can take the following values:

    code

    Required. The code to be executed

    lang

    Required. JScript | VBScript | JavaScript

    4

     

     

     

    focus()

    Sets focus on the current window

    4

    1

    3

     

    moveBy(x,y)

    Moves the window a specified number of pixels in relation to its current co-ordinates

    4

    1

    4

     

    moveTo(x,y)

    Moves the window's left and top edge to the specified co-ordinates

    4

    1

    4

     

    navigate("URL")

    Loads the specified URL into the window

    3

     

     

     

    open()

    Opens a new browser window

    3

     

     

     

    print()

    Prints the contents of the current window

    5

    1

    4

     

    prompt()

    Displays a dialog box that prompts the user for input

    3

    1

    2

     

    resizeBy()

    Resizes the window by the specified pixels

    4

     

     

     

    resizeTo()

    Resizes the window to the specified width and height

    4

    1.5

     

     

    scroll()

    Deprecated. Use scrollTo() instead

    4

     

     

     

    scrollBy()

    Scrolls the content by the specified number of pixels

    4

    1

    4

     

    scrollTo()

    Scrolls the content to the specified coordinates

    4

    1

    4

     

    setActive()

     

    5

     

     

     

    setInterval(code, millisec[, "lang"])

    Calls a function / evaluate an expression every time a specified interval (in milliseconds) has been reached. The arguments can take the following values:

    code

    Required. A pointer to a function or the code to be executed

    millisec

    Required. The number of milliseconds

    lang

    Optional. JScript | VBScript | JavaScript

    4

    1

    4

     

    setTimeout()

    Calls a function or evaluates an expression after a specified number of milliseconds

    3

    1

    2

     

    showHelp("URL"[, contextID])

    Displays a Help file (must be of type .htm or .chm). When using this method, a second Help box appears when pressing F1 or when clicking Help on the menu bar. To prevent the default Help box from appearing set returnValue to false. The arguments can take the following values:

    URL

    Required. The URL of a Help file

    contextID

    Optional. A string or integer that specifies a context identifier in the Help file

    4

     

     

     

    showModalDialog("URL"[, args, "list"])

    Loads a URL in a modal dialog box. A modal dialog box retains focus while open. The user CANNOT switch windows until the dialog box is closed. The arguments can take the following values:

    "URL" - Required. The URL of the document to display.

    args - Optional. The arguments to use when displaying the URL. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values from the dialogArguments property of the window object.

    "list" - Optional. Specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values:

    dialogHeight : number

    the height* of the dialog window

    dialogLeft : number

    the left position of the dialog window

    dialogTop : number

    the top position of the dialog window

    dialogWidth : number

    the width* of the dialog window

    center : yes | no | 1 | 0 | on | off

    whether to center the dialog window within the desktop. Default is yes

    dialogHide : yes | no | 1 | 0 | on | off

    whether the dialog window is hidden when printing. Only available when a dialog box is opened from a trusted application. Default is no

    edge : sunken | raised

    the edge style of the dialog window. Default is raised

    help : yes | no | 1 | 0 | on | off

    whether the dialog window displays the Help icon. Default is yes

    resizable : yes | no | 1 | 0 | on | off

    whether the dialog window is resizable. Default is no

    scroll : yes | no | 1 | 0 | on | off

    whether the dialog window displays scrollbars. Default is yes

    status : yes | no | 1 | 0 | on | off

    whether the dialog window displays a status bar. Default is yes for untrusted dialog windows and no for trusted dialog windows

    unadorned : yes | no | 1 | 0 | on | off

    whether the dialog window displays the border window chrome. Only available when a dialog window is opened from a trusted application. Default is no

    4

     

     

     

    showModelessDialog("URL"[, args, "list"])

    Loads a URL in a modeless dialog box. The modeless dialog box displays even when the user switches focus to another window (useful for menus and Help systems). The arguments can take the following values:

    "URL" - Required. The URL of the document to display.

    args - Optional. The arguments to use when displaying the URL. Use this parameter to pass a value of any type, including an array of values. The dialog box can extract the values from the dialogArguments property of the window object.

    "list" - Optional. Specifies the window ornaments for the dialog box, using one or more of the following semicolon-delimited values:

    dialogHeight : number

    the height* of the dialog window

    dialogLeft : number

    the left position of the dialog window

    dialogTop : number

    the top position of the dialog window

    dialogWidth : number

    the width* of the dialog window

    center : yes | no | 1 | 0 | on | off

    whether to center the dialog window within the desktop. Default is yes

    dialogHide : yes | no | 1 | 0 | on | off

    whether the dialog window is hidden when printing. Only available when a dialog box is opened from a trusted application. Default is no

    edge : sunken | raised

    the edge style of the dialog window. Default is raised

    help : yes | no | 1 | 0 | on | off

    whether the dialog window displays the Help icon. Default is yes

    resizable : yes | no | 1 | 0 | on | off

    whether the dialog window is resizable. Default is no

    scroll : yes | no | 1 | 0 | on | off

    whether the dialog window displays scrollbars. Default is yes

    status : yes | no | 1 | 0 | on | off

    whether the dialog window displays a status bar. Default is yes for untrusted dialog windows and no for trusted dialog windows

    unadorned : yes | no | 1 | 0 | on | off

    whether the dialog window displays the border window chrome. Only available when a dialog window is opened from a trusted application. Default is no

    5

     

     

     

    * The default unit of measure for dialogHeight and dialogWidth in IE4 is em; in IE5 it is px. Other values to use: cm, mm, in, pt, pc, or ex. For consistent results, use px! Note: The min. dialogHeight you can specify is 100px.

    Javascript Window Object Events

    Syntax: window.event_name="someJavaScriptCode"

    Event

    Description

    IE

    F

    N

    W3C

    onBlur

    Executes some code when a Blur event occurs

     

    1

    3

     

    onError

    Executes some code when an Error event occurs

     

    1

    3

     

    onFocus

    Executes some code when a Focus event occurs

     

    1

    3

     

    onLoad

    Executes some code when an Load event occurs

     

    1

    2

     

    onResize

    Executes some code when a Resize event occurs

     

    1

    4

     

    onUnload

    Executes some code when an Unload event occurs

     

    1

    2

     

     

     

     





















     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

  • Javascript |