Popup window code

What's the best way to open a new window without the scrollbars etc?

Thanx




something like:

<a href=\"somepage.html\" onclick=\"window.open(this.href, 'popup', 'width=600,height=600'); return false\">click me</a>

The return false part makes sure the parent window doesn't load the url in the href (onclick is before href in the event order). This is valid code for HTML strict doctype where you can no longer use "target". I have seen some funny work arounds for that.

those backslashes should be removed

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options