allee100
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")
bookWindow.focus()
}
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
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
and here is the code that calls this function in the body:
onChange="MM_jumpMenu('newWindow()',this,0)">
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?
function newWindow(bookjpg) {
bookWindow = window.open(bookjpg, "bookWin", "toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=870,height=800")
bookWindow.focus()
}
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
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
and here is the code that calls this function in the body:
onChange="MM_jumpMenu('newWindow()',this,0)">
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?