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

L

Lucy

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',blah)"

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
 
L

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',blah)"

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.
 
L

Lucy

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
 
K

kaeli

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).

--
 
M

Michael Winter

<a
href="javascript:eek:penWindow('<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
 
T

Tony Morris

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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top