window properties from java script....

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Brown Smith

    window properties from java script....

    How to get the browser window properties at run time through java script
    code?

    When my ASP.Net application is launched (through IE only) I am interested
    with the following properties from client side code.

    Where exactly the browser is located on the screen. Interested in left and
    top properties. And the height and width of the browsing instance window.

    I am trying to set the same height and width and location when the user
    launches the my application next time.

    Thanks,

    Smith


  • Brown Smith

    #2
    Re: window properties from java script....

    I am trying to read document.width and document.height .
    When I try to read the above values it says undefined.
    Why?
    I am using IE5.5+
    Thanks,
    Smith


    "Brown Smith" <BB_Smith34@hot mail.com> wrote in message
    news:eHVmMP4cFH A.2760@tk2msftn gp13.phx.gbl...[color=blue]
    > How to get the browser window properties at run time through java script
    > code?
    >
    > When my ASP.Net application is launched (through IE only) I am interested
    > with the following properties from client side code.
    >
    > Where exactly the browser is located on the screen. Interested in left and
    > top properties. And the height and width of the browsing instance window.
    >
    > I am trying to set the same height and width and location when the user
    > launches the my application next time.
    >
    > Thanks,
    >
    > Smith
    >
    >[/color]


    Comment

    • Bart

      #3
      Re: window properties from java script....

      This snippet always works for me:

      if (window.innerWi dth == null) {
      // microsoft version
      var width = document.docume ntElement.offse tWidth;
      var height = document.docume ntElement.offse tHeight; }
      else {
      // netscape version
      var width = window.innerWid th;
      var height = window.innerHei ght; }

      Not sure if it's possible to determine the position of the browser window
      though.

      Bart

      "Brown Smith" <BB_Smith34@hot mail.com> wrote in message
      news:eHVmMP4cFH A.2760@tk2msftn gp13.phx.gbl...[color=blue]
      > How to get the browser window properties at run time through java script
      > code?
      >
      > When my ASP.Net application is launched (through IE only) I am interested
      > with the following properties from client side code.
      >
      > Where exactly the browser is located on the screen. Interested in left and
      > top properties. And the height and width of the browsing instance window.
      >
      > I am trying to set the same height and width and location when the user
      > launches the my application next time.
      >
      > Thanks,
      >
      > Smith
      >
      >[/color]


      Comment

      Working...