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

Discussion in 'Javascript' started by Lucy, Dec 30, 2003.

  1. Lucy

    Lucy Guest

    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
     
    Lucy, Dec 30, 2003
    #1
    1. Advertising

  2. Lucy

    Lee Guest

    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.
     
    Lee, Dec 30, 2003
    #2
    1. Advertising

  3. Lucy

    Lucy Guest

    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" <> wrote in message
    news:p...
    > 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:eek:penWindow('<url>','<title>',<window-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: )
    > http://MadDogsBreakfast.com - Travel Tales: The good, bad, and down-right

    ugly
    >
     
    Lucy, Dec 30, 2003
    #3
  4. Lucy

    kaeli Guest

    In article <bssjo6$rsn$>,
    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
     
    kaeli, Dec 30, 2003
    #4
  5. On Wed, 31 Dec 2003 06:13:54 +1100, kingsley
    <> wrote:

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

    --
    Michael Winter
    d (replace ".invalid" with ".uk" to reply)
     
    Michael Winter, Dec 30, 2003
    #5
  6. Lucy

    Tony Morris Guest

    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" <> wrote in message
    news:bss18l$jt5$...
    > 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
    >
    >
    >
     
    Tony Morris, Dec 31, 2003
    #6
  7. Lucy

    Jim Ley Guest

    On Tue, 30 Dec 2003 20:15:30 GMT, Michael Winter
    <> wrote:

    >On Wed, 31 Dec 2003 06:13:54 +1100, kingsley
    ><> wrote:
    >
    >> <a
    >> href="javascript:eek:penWindow('<url>','<title>',<window-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/
     
    Jim Ley, Jan 1, 2004
    #7
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    4
    Views:
    3,554
    Whitecrest
    Jun 1, 2004
  2. mohit
    Replies:
    0
    Views:
    602
    mohit
    Jan 23, 2008
  3. Matt
    Replies:
    1
    Views:
    184
    Evertjan.
    Jun 1, 2004
  4. Simon Wigzell

    Target for form to open in same window

    Simon Wigzell, Jun 14, 2004, in forum: Javascript
    Replies:
    1
    Views:
    139
    David Dorward
    Jun 14, 2004
  5. DonD
    Replies:
    8
    Views:
    409
    Phat G5 (G3)
    Aug 5, 2005
Loading...

Share This Page