PDA

View Full Version : load into frames in popup - works locally but not remotely?


loonatik
05-25-2003, 02:58 AM
I use this script on index.html to open enter.html as a pop-up.

function enter(section){
w = window.open("enter.html","")
w.onload=new function(){
w.menu.location.href = section+".html";
w.main.location.href = section+".html";
}
}

enter.html has two iframes with names 'menu' and 'main'. I open the page with a link on index.html <a href="javascript:enter('profile')">link</a>.
It works locally on my computer, but when I test it online, I get this error: w.menu.location.href is null or not an object

Anyone know whats wrong? It works fine offline.
Thanks!!

joh6nn
05-25-2003, 10:59 PM
try this:

function enter(section){
var w = window.open("enter.html","")
w.onload = function() {
w.frames[menu].location.href = section + ".html";
w.frames[main].location.href = section + ".html";
}
}

loonatik
05-27-2003, 08:30 PM
the error now is 'menu is undefined'. same for main. thanks.

joh6nn
05-27-2003, 10:18 PM
whoops, typo. try it now:

try this:

function enter(section){
var w = window.open("enter.html","")
w.onload = function() {
w.frames["menu"].location.href = section + ".html";
w.frames["main"].location.href = section + ".html";
}
}