Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question I need help with popping up windows

    Hello, I own a tourist site for the city of Providence, Rhode Island (http://www.scoutprovidence.com) and have been trying to making updates as easy as possible. To do this, I use SSI and just began using JavaScript commands.

    Let me explain my problem:

    In the page here: http://www.scoutprovidence.com/secti...downtown.shtml you'll see that I have a listing of hotels in the Downtown Providence area. Of course, this listing is useless without directions, so I'm trying to post a link to directions that will pop up a window from a file in a separate folder. Instead of making one function for each directions popup, I'm trying to make it much easier for myself by making just one function that will link the directions from one hotel to its corresponding directions.

    By doing that, in the script in the head command has this one function:

    function directions(filename, hotelname)
    {
    window.open('/sections/site/dirindex/accomodations/' + filename + '.html', 'Directions to ' + hotelname, config='height=300,width=200,toolbar=0,menubar=0,location=0,directories=0,status=0');
    }
    And then, the link in that URL I have above (next to Biltmore Hotel) has the following A tag:

    <A HREF="" onClick="directions('biltmore', 'The Biltmore Hotel')">

    As you can see, the biltmore variable was intended to make that function load "/sections/dirindex/accomodations/biltmore.html . "The Biltmore Hotel" variable should make the title of this window, "Directions to The Biltmore Hotel".

    Having a feeling that this script wasn't going to work, I uploaded directions.shtml, loaded it on my browser, and it found an error: "Object Expected: Line: 178 Character: 1".

    I have no clue what could be the problem. Line 178 is where the A tag is, (although the A tag is actually in a shared .html file called by the "include virtual" SSI tag, I don't know if that has anything to do with it.)

    Can anyone find the problem? I fear that someone is going to find some stupid thing I missed and make me embarrassed. But don't be afraid to tell it to me, since I'm already frustrated by this JavaScript problem.

    EDIT: I just remembered that the hosting service just went down temporarily for server maintenence, so you won't be able to go to the URL I posted.
    Last edited by RandHuck; 02-20-2003 at 02:41 AM.

  • #2
    Regular Coder Skyzyx's Avatar
    Join Date
    Aug 2002
    Location
    Silicon Valley, CA
    Posts
    980
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Remove the "config=" part from your window.open() line.

    Creator of SimplePie and Tarzan AWS, co-founder of WarpShare, co-built the Y! Messenger website, usability-focused, and an INFJ personality.

  • #3
    New to the CF scene
    Join Date
    Feb 2003
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi.

    I'm afraid it didn't work, the same error pops up. Thanks, though.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    the second parameter of window.open is the target or window name (not the title of the window as you said). It should not contain spaces or other special characters. Underscores can be used.

    <a href="" onClick="directions('biltmore', 'The_Biltmore_Hotel');return false">Directions</a>


  •  

    Posting Permissions

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