PDA

View Full Version : Opening browser window with certain functions


kpd
09-10-2002, 03:34 PM
Hi,

I'm using JavaScript to pick up a consultant's id # and put it at the end of the URL so that when an ID# is entered, the person is taken to that consultant's website.

function goTo() {
var cons_id = prompt("Please type in your Consultant ID number here", "");
consSite = window.open("http://www.sampleurl.com/" + cons_id +"/");
}

The code works, except that when the Consultant's window opens, there are no features, such as the back button, location, etc.

I've tried adding features, as shown below, but only the first feature will work... I get the toolbar, but not the location, etc.

function goTo() {
var cons_id = prompt("Please type in your Consultant ID number here", "");
consSite = window.open("http://www.sampleurl.com/" + cons_id +"/", "", "toolbar", "location");
}

What am I doing wrong? Or, do I need to approach it differently?

It's called out like this:

Click <a href="#" onClick="goTo(); return false;">here</a> to
view your Consultant's website.

Thanks in advance for any help,
Kathy

requestcode
09-10-2002, 03:50 PM
Just a formatting problem. Try this:
consSite = window.open("http://www.sampleurl.com/" + cons_id +"/", "win1", "toolbar=yes,location=yes");

Add the other properties you need.

ShriekForth
09-10-2002, 05:08 PM
FYI, if that is not getting you all that you want to see on the new window, there are a few other options available, for example

toolbar=yes,status=yes,menubar=yes,scrollbars=yes,height=640,width=480

one Reference (http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_m-q.htm#177627) can be found on netscapes site.

ShriekForth

kpd
09-11-2002, 03:08 AM
Thank you both for your quick responses. This problem really had me stumped.

I'm not at work now and don't have access to that page to try it out, but will modify it as I'm back at work.

Thanks again,
Kathy

beetle
09-11-2002, 04:38 AM
easiest way to open a fully-featured browser window with the window.open() method is to use '_blank' as the targetwindow.open("http://www.sampleurl.com/" + cons_id +"/", "_blank","");

kpd
09-18-2002, 04:52 AM
Hi,

Sorry to be so long in my response. The first two suggestions worked great with no problems, but for some reason the last didn't. It still opened a window without any features.

Thank you all for your help, it is appreciated.

Kathy