#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2000
    Location
    CT, USA
    Posts
    11
    Rep Power
    0

    Javascript Popup Help


    I'm trying to make a javascript popup that goes like this:

    I would have a link with the code <A HREF="javascript:info('226')">

    Based on that 226 (it could be any number) I would get a popup window with the url index.php?id=226 (where 226 is the number in the href link).

    Thanks for any help.
  2. #2
  3. No Profile Picture
    Seņor Member
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2000
    Posts
    1,157
    Rep Power
    37
    That sounds easy - let me know if I can't see the forest for the trees.

    <A HREF="Java&#83cript:window.open('226.html')">

    -or-
    Code:
    function info(var) {
         window.open(var + '.html');
    }
    Michael
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2001
    Location
    la, ca
    Posts
    84
    Rep Power
    13
    Try this:

    <script language="JavaScript" type="text/JavaScript">
    function info(page){
    var theWin = null;
    var theURL = "index.php?id=" + page;
    theWin = window.open(theURL,'newwin','500,300,no,no');
    }
    </script>

    The arguments to window.open are:
    1) The URL you want to go to (in this case, the variable theURL)
    2) The name of the window
    3) The height and width, and whether the window is scrollable or resizable.

IMN logo majestic logo threadwatch logo seochat tools logo