faqts : Computers : Programming : Languages : JavaScript : Windows

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

41 of 54 people (76%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I open a new window at the same position as the old?

Apr 24th, 2000 06:00
Martin Honnen,


The current window's coordinates are
  window.screenX
  window.screenY
in NN and
  window.screenLeft
  window.screenTop
in IE. Thus assign
  if (document.all) {
    var x = window.screenLeft;
    var y = window.screenTop;
  }
  else {
    var x = window.screenX;
    var y = window.screenY;
  }
  open ('http://JavaScript.FAQTs.com', 'faqts',
        'left=' + x + ',top=' + y + ',resizable=1,scrollbars=1')