[thelist] Child windows from invalid JS / browser errs sought

Andrew Clover and-evolt at doxdesk.com
Wed Jul 3 07:12:01 CDT 2002


Ron Luther <Ron.Luther at hp.com> wrote:

> <a href="/gbl/eStuff.htm?sapid=0000503&amp;sordernb=0004588"
> title="Check order status in eStuff (opens in a new browser window)"
> onclick="window.open('/gbl/eStuff.htm?sapid=0000503&amp;sordernb=0004588');return false;">

You could replace that long URL in window.open with this.href to make
it a bit easier to manage.

window.open without any options parameter can be problematic in IE
and Netscape 4 (you always get the default toolbars, including the
links/personal bar, even if you have turned them off in the prefs) and
in Opera and Konqueror (where you get a window with no toolbars at
all). The alternative, having to specify exactly which toolbars to display,
also runs the risk of going against the user's preferences, so this is a
bit of a no-win situation.

> <a href="/gbl/eStuff.htm?sapid=0000503&amp;sordernb=0004588"
> title="Check order status in eStuff (opens in a new browser window)"
> target="new">

Bad. This will open in a window called 'new', then if you navigate to
somewhere else in that window and click another link with target="new"
the existing window will be changed. Very annoying. The proper syntax
for open-in-new-window is 'target="_blank"'.

A solution that uses target but still validates as Strict is to use
JavaScript to overwrite the targets, eg.:

  <a href="x.html" class="popup">hello</a>
    ...
  <script type="text/javascript">
    for (var i= document.links.length; i-->0;)
      if (document.links[i].className=='popup')
        document.links[i].target= '_blank';
  </script>

but in general I have to agree with Rudy - I prefer to avoid
auto-open-in-new-window when possible, as it annoys many people.

--
Andrew Clover
mailto:and at doxdesk.com
http://and.doxdesk.com/



More information about the thelist mailing list