View Full Version : how to get a jumpmenu to open in specified new window

05-05-2004, 03:07 AM
I have a web page with many links opening in a new window. The opening of this new window is governed by a JS Function that I wrote:

function newWindow(bookjpg) {
bookWindow = window.open(bookjpg, "bookWin", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=870,height=800")
This is workign perfectly for all the links on the page-opening in the correct window. But, I have a jumpmenu that also links to various parts of my site that I want to be governed by this same newWindow function. Of course, it is not and I do not know how to integrate these two functions. Here is the code for the jumpmenu:

function MM_jumpMenu(targ,selObj,restore){ //v3.0
if (restore) selObj.selectedIndex=0;

and here is the code that calls this function in the body:


As you can see I have substituted 'newWindow' for the target info. This is not working. (This was my best guess at trying to make this work). When I test this in the browse I get the error 'undefined' is null or not an object. I think it is stemming from the eval() part of the jumpmenu code.

Any thoughts?

05-05-2004, 03:55 AM
Put a target parameter in the newWindow function.

function newWindow(bookjpg, target) {
var bookWindow = window.open(bookjpg, target, "toolbar=yes,location=yes,status=yes,menubar=yes,sc rollbars=yes,resizable=yes,width=870,height=800");

function MM_jumpMenu(targ,selObj,restore){ //v3.0
newWindow(selObj.options[selObj.selectedIndex].value, targ);
if (restore) selObj.selectedIndex=0;

then change the call to newWindow by all the links to:

newWindow('url', 'bookWin')

But if you want all the links and the pages in the option items opened to the same popup window, the targ parameter in the call to the MM_jumpMenu function on onchange event, should be the same with that of the links:


05-05-2004, 10:12 PM
You pretty much rock!!!!!!
That saved me about 20 hours of pulling my hair out.

Thanks much