SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    Jul 1999
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could someone please tell me the code to automatically open a new when the current window is requested. Also, how do I specify the size of this new window?

    Cheers,

    Ben

  2. #2
    SitePoint Enthusiast Morpheos's Avatar
    Join Date
    Feb 2000
    Location
    Miches, DR.
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hello...

    i can tell u the way how to open a new window for a link:

    in the link syntax you write:

    <a target="_blank" href="whatever.html">

    the target signature is the clue..



    ------------------
    Morpheos, God of Sleep

  3. #3
    SitePoint Addict
    Join Date
    Feb 2000
    Location
    District of Columbia
    Posts
    373
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if I understand you correctly you are looking for this:

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    &lt;!--
    function my_win()
    {
    window.open('yourURL','mywindow','width=430,height=500,
    toolbar=no,location=no,directories=no,
    status=no,menubar=yes,scrollbars=no,
    copyhistory=no,resizable=no');
    }
    //--&gt;

    [/code]

    and to open a window do this:

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">code/font><HR><pre>
    &lt;a href="javascript:my_win()"&gt;
    [/code]

    HTH

    [This message has been edited by temis (edited February 16, 2000).]

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 1999
    Location
    Minneapolis, MN, USA
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I made an automatic pop-up window generator, which currently only works in IE (I'm working on fixing that...), at least I think it only works in IE (I havn't really finished checking it for bugs). To use it go to its located at... http://www.4webmasters.net/create/wgen.htm

    Hope that helps

    ------------------
    John Schrom
    Webmaster - 4Webmasters


  5. #5
    SitePoint Member
    Join Date
    Jul 1999
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What part of the html do the above sripts go in to? Also, can the URLs be relative ie

    /newpage.html

    instead of
    www.mysite.com/newpage.html

    Cheers,

    Ben

  6. #6
    SitePoint Enthusiast
    Join Date
    Dec 1999
    Location
    Minneapolis, MN, USA
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, they can be relative urls - just delete the "http://".

    hmm...you'd need to make some changes to have it open when a user clicks a link. To do this you need to edit the script. At the beginning of the script (right after the &lt;script&gt; tag) put "function openwin(){" and at the end of the script (right before the &lt;/script&gt; tag) put "}". Then, to call this make a link "&lt;a href="#top" onclick="openwin()"&gt;". You'd put the script inside the &lt;head&gt; tag.


    ------------------
    John Schrom
    Webmaster - 4Webmasters



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •