View Full Version : I need help with popping up windows

02-20-2003, 02:30 AM
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/sections/accomodations/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.

02-20-2003, 02:49 AM
Remove the "config=" part from your window.open() line.

02-20-2003, 02:57 AM

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

02-20-2003, 04:20 AM
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>