🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: aus.computers.java
Article #85

Re: help! javascript inline of an HTML to open an HTML in a target window

#85
From: Michael Winter
Date: Tue, 30 Dec 2003 20:15
50 lines
3074 bytes
On Wed, 31 Dec 2003 06:13:54 +1100, kingsley 
<kingsley@maddogsbreakfast.com.au> wrote:

> <a
> href="javascript:openWindow('<url>','<title>',<window-width>,<window-length>);">

I assume that's IE-specific? If it is, say so in future. The cross-browser 
method would be:

   window.open('url','target_name','features');

The target_name is used with HTML Transitional attributes like:

   <A href="..." target="target_name">...</A>

To declare the title of the page, you must use the TITLE element. To set 
the window size (bad idea), specify it in the 'features' string:

   window.open('...','...','width=x,height=y');

One final comment; DON'T USE JAVASCRIPT PSEUDO-URIs:

1) The correct way of specifying the script language is through the use of 
a META element:

   <META http-equiv="Content-Script-Type" content="text/javascript">

    Not all browsers use Microsoft's initiatives.

2) The onclick event should be used to trigger actions when an element is 
clicked, and the URI should point to an alternative, non-javascript page 
that shows the same content as the action, or an explanation as to why the 
user cannot view it:

   <A href="alternative.html" onclick="window.open(...);return 
false">...</A>

If there is no alternative content, you might use a button instead of a 
text link:

   <BUTTON type="button" onclick="window.open(...)">...</BUTTON>

Mike


Follow-ups set to c.l.js

-- 
Michael Winter
M.Winter@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Technical Details
Message-ID: <opr00fusvo5vklcq@news-text.blueyonder.co.uk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed.stueberl.de!teaser.fr!wanadoo.fr!proxad.net!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-text.cableinet.net!53ab2750!not-for-mail
References: <bss18l$jt5$1@gnamma.connect.com.au> <pan.2003.12.30.19.13.51.156282@maddogsbreakfast.com.au>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d6db,7491ca8b4d7c0d54
X-Google-Attributes: gid10d6db,public
X-Google-Thread: fb3cb,7491ca8b4d7c0d54
X-Google-Attributes: gidfb3cb,public
X-Google-Thread: 1047b3,7491ca8b4d7c0d54
X-Google-Attributes: gid1047b3,public
X-Google-ArrivalTime: 2003-12-30 12:15:31 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!newsfeed.stueberl.de!teaser.fr!wanadoo.fr!proxad.net!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-text.cableinet.net!53ab2750!not-for-mail
Newsgroups: aus.computers.java,comp.lang.javascript,microsoft.public.scripting.wsh
Subject: Re: help!  javascript inline of an HTML to open an HTML in a target window
References: <bss18l$jt5$1@gnamma.connect.com.au> <pan.2003.12.30.19.13.51.156282@maddogsbreakfast.com.au>
Message-ID: <opr00fusvo5vklcq@news-text.blueyonder.co.uk>
Followup-To: comp.lang.javascript
From: Michael Winter <M.Winter@blueyonder.co.invalid>
Content-Type: text/plain; format=flowed; charset=iso-8859-15
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
User-Agent: Opera7.23/Win32 M2 build 3227
Lines: 50
Date: Tue, 30 Dec 2003 20:15:30 GMT
NNTP-Posting-Host: 213.48.80.250
X-Complaints-To: abuse@blueyonder.co.uk
X-Trace: news-text.cableinet.net 1072815330 213.48.80.250 (Tue, 30 Dec 2003 20:15:30 GMT)
NNTP-Posting-Date: Tue, 30 Dec 2003 20:15:30 GMT
Organization: blueyonder (post doesn't reflect views of blueyonder)