WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 target attribute in DHTML 4, jean Nguimbus, December 2, 2004
     Re:target attribute in DHTML 4, Guilherme Blanco, December 7, 2004
         Re:target attribute in DHTML 4, Jean Nguimbus, December 8, 2004

Subject: Re:target attribute in DHTML 4 From: Guilherme Blanco Date: December 7, 2004


If you point to target _blank, it'll open a new window with your preferred options (like toolbars, size, ...) and you won't control it.

To solve it, you can, instead of set in the action a URL, you can define as a JS function.

So... instead of 'http://www.domain.com/somepage.jsp', you can define: 'javascript:handlePopupWindow(http://www.domain.com/somepage.jsp, 400, 300)'

And create a custom handler to it, like:

function handlePopupWindow(sUrl, iWidth, iHeight) {
  var iTop = ((screen.height - iHeight)/2);
  var iLeft = ((screen.width - iWidth)/2)

  window.open(sUrl, 'myWin', 'top='+iTop+', left='+iLeft+', width='+iWidth+', height='+iHeight+', ....');

I hope it helps,


Gui Blanco

From: jean Nguimbus
Sent: December 2, 2004
Subject: Re:target attribute in DHTML 4

Hi there,

I am using DHTML Menu 4.

I can get tmp.target = "_blank" to open a new window, but, if possible, how  and where in the code do I set the height, width, position (e.g. center), whether or not the menubar, scrollbars, status, etc. should appear for that new window?

Any help would be greatly appreciated.

Jean Nguimbus    


Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.

View All Messages
Back to WebFX