By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,498 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,498 IT Pros & Developers. It's quick & easy.

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

P: n/a
help! javascript inline of an HTML to open an HTML in a target window.
Something like...

<html>
<head>
<title>test</title>
</head>

<body>

hello, world!<BR><BR>

javscript:"window.open('file.html','NewWindow',bla h)"

But I can't remember, can't find an example and i really need a way
to open a html file in a window without the user pressing a key or anything.

ANY help would be appreciated. This is due in a few hours and it's the last
bit of code to drop in.

Thanks!

lucyh at dhimaging dot com dot au

Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Lee
Lucy said:

help! javascript inline of an HTML to open an HTML in a target window.
Something like...

<html>
<head>
<title>test</title>
</head>

<body>

hello, world!<BR><BR>

javscript:"window.open('file.html','NewWindow',bl ah)"

But I can't remember, can't find an example and i really need a way
to open a html file in a window without the user pressing a key or anything.


<script type="text/javascript">
window.open("file.html","NewWindow","blah")
</script>

But don't expect it to work for many people, since it's become
popular to disable popup windows.

Jul 20 '05 #2

P: n/a
On Wed, 31 Dec 2003 01:11:21 +1100, Lucy wrote:
help! javascript inline of an HTML to open an HTML in a target window.
<a
href="javascript:openWindow('<url>','<title>',<win dow-width>,<window-length>);">
But I can't remember, can't find an example and i really need a way
to open a html file in a window without the user pressing a key or anything.


Eeek! I hate that - I have mozilla disable it,
no un-requested popups for me...

-kt

--
Kingsley Turner,
(mailto: ki******@maddogsbreakfast.com.au)
http://MadDogsBreakfast.com - Travel Tales: The good, bad, and down-right ugly

Jul 20 '05 #3

P: n/a
its NOT a pop-up - I need to refresh content in a frame/iframe based on
which keystroke the user presses...

NOT A POPUP...
does anyone have any ideas...

lucyh
"kingsley" <ki******@maddogsbreakfast.com.au> wrote in message
news:pa****************************@maddogsbreakfa st.com.au...
On Wed, 31 Dec 2003 01:11:21 +1100, Lucy wrote:
help! javascript inline of an HTML to open an HTML in a target window.
<a

href="javascript:openWindow('<url>','<title>',<win dow-width>,<window-length>
);">
But I can't remember, can't find an example and i really need a way
to open a html file in a window without the user pressing a key or
anything.
Eeek! I hate that - I have mozilla disable it,
no un-requested popups for me...

-kt

--
Kingsley Turner,
(mailto: ki******@maddogsbreakfast.com.au)
http://MadDogsBreakfast.com - Travel Tales: The good, bad, and down-right ugly

Jul 20 '05 #4

P: n/a
In article <bs**********@gnamma.connect.com.au>, so*****@somewhere.com
enlightened us with...
its NOT a pop-up - I need to refresh content in a frame/iframe based on
which keystroke the user presses...


Capture the keystroke (how to do that is in the archives) and have the
action refresh the frame/iframe (also in the archives).

--
--
~kaeli~
What do they use to ship styrofoam?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5

P: n/a
On Wed, 31 Dec 2003 06:13:54 +1100, kingsley
<ki******@maddogsbreakfast.com.au> wrote:
<a
href="javascript:openWindow('<url>','<title>',<win dow-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.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 20 '05 #6

P: n/a
Out of pure curiosity, why is a Javascript question posted to what I believe
is a Java forum (correct me if it is not) ?
Do you not realise the difference between the Java 2 Programming Language
developed by Sun Microsystems and HTML/Javascript ?

--
Tony Morris
(BInfTech, Cert 3 I.T., SCJP[1.4], SCJD)
Software Engineer
IBM Australia - Tivoli Security Software

"Lucy" <so*****@somewhere.com> wrote in message
news:bs**********@gnamma.connect.com.au...
help! javascript inline of an HTML to open an HTML in a target window.
Something like...

<html>
<head>
<title>test</title>
</head>

<body>

hello, world!<BR><BR>

javscript:"window.open('file.html','NewWindow',bla h)"

But I can't remember, can't find an example and i really need a way
to open a html file in a window without the user pressing a key or anything.
ANY help would be appreciated. This is due in a few hours and it's the last bit of code to drop in.

Thanks!

lucyh at dhimaging dot com dot au

Jul 20 '05 #7

P: n/a
On Tue, 30 Dec 2003 20:15:30 GMT, Michael Winter
<M.******@blueyonder.co.invalid> wrote:
On Wed, 31 Dec 2003 06:13:54 +1100, kingsley
<ki******@maddogsbreakfast.com.au> wrote:
<a
href="javascript:openWindow('<url>','<title>',<win dow-width>,<window-length>);">


I assume that's IE-specific?


Nope, made up (presumanly they have an include file providing it)

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 20 '05 #8

P: n/a
On Tue, 30 Dec 2003 20:15:30 +0000, Michael Winter wrote:
On Wed, 31 Dec 2003 06:13:54 +1100, kingsley
<ki******@maddogsbreakfast.com.au> wrote:
<a
href="javascript:openWindow('<url>','<title>',<win dow-width>,<window-length>);">


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


I dunno, I've never tested it with IE, only mozilla, netscape & konquerer

-kt

--
Kingsley Turner,
(mailto: ki******@maddogsbreakfast.com.au)
http://MadDogsBreakfast.com - Travel Tales: The good, bad, and down-right ugly

Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.