SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Peterborough, England
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you change the size of the window that loads, when a new window is opened from a link?

    The HTML of the page I would to alter is:

    <HTML>
    <HEAD>
    <TITLE>Enter Password</TITLE>

    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from tired old browsers that should be put to pasture.


    function goForit() {
    var location;
    var password;
    password=this.document.testform.inputbox.value
    location=password + ".html"
    fetch(location)
    theKeeper=window.close()
    }

    function fetch(location) {
    var root;
    if (opener.closed) {
    root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
    } else {
    opener.location.href = location;
    }
    }

    // End hiding --->
    </SCRIPT>

    </HEAD>

    <BODY BACKGROUND="backgroundWCC2.jpg">

    <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=46% height="43">
    <TR>
    <TD WIDTH=50% height="75">
    <img border="0" src="matthewbent.com.jpg">
    <TR>

    <TD WIDTH=75% ALIGN=CENTER VALIGN=MIDDLE height="1">
    <FONT FACE="ARIAL" SIZE=2><B>Please enter the password then click &quot;Submit
    Password&quot;.</B></FONT><BR>
    &nbsp;
    <TR>
    <TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM height="29">
    <CENTER>
    <FORM NAME="testform">
    <INPUT TYPE="text" NAME="inputbox" VALUE="" size=20>
    <INPUT TYPE="submit" NAME="button" Value="Submit Password" onClick="goForit(this.form)">





    </FORM>
    </CENTER>


    </TABLE>

    </BODY>

    </HTML>


    I look forward to a reply,

    Internationally.

  2. #2
    SitePoint Wizard westmich's Avatar
    Join Date
    Mar 2000
    Location
    Muskegon, MI
    Posts
    2,328
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Place this code on the page that you will be opening the link from.


    <html>
    <head>
    <title>Opening a Window</title>
    <SCRIPT LANGUAGE=JAVASCRIPT TYPE="TEXT/JAVASCRIPT">
    <!-- Hide script from old browsers

    function newWindow(mySite) {
    newWindow = window.open (mySite, 'newWin', 'width=330,height=250,top=50,left=50,scrollbar=no,toolbar=no,location=no')
    }

    // End hiding script from old browsers -->
    </SCRIPT>
    </head>

    <body>

    <a href="javascript:newWindow('http://www.yahoo.com')">link</a>

    </body>

    </html>
    Westmich
    Smart Web Solutions for Smart Clients
    http://www.mindscapecreative.com

  3. #3
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    No need to completely recode your JavaScript, simply modify the line below:

    Code:
    root=window.open('','theKeepersGopher','toolbar=yes,
    location=yes,status=yes,menubar=yes,scrollbars=yes,
    resizable=yes,copyhistory=no,width=600,height=400');
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference


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
  •