R
rob
Hello,
I am opening a child window, and populating it with a document.write.
In the document.write text is a javascript function, which I call
immediatly after I call the document.write in the parent function.
Firefox complains that the function in the child window "is not a
function". However, if I call that same child function later from
another event, it works fine. Any idea what would cause this? Here
is what I am doing in code:
var myWindow = null;
function show_new_win() {
var content = "some content";
if (myWindow==null) {
myWindow=window.open('','OrigFileWindow','width=1200,height=1200');
myWindow.document.write("<html><head><link type='text/css'
rel='stylesheet'
href='style.css'><script> function
mytest(id, pos){var newdiv =
document.getElementById(id);newdiv.className='highlightcnum';var
outerdiv = document.getElementById('innerfile');
outerdiv.scrollTop=pos; }<\/script></head><body >" + content + "</
body></html>");
}
myWindow.mytest("h_" + mycnum ,500);
}
Thanks for any insights.
}
I am opening a child window, and populating it with a document.write.
In the document.write text is a javascript function, which I call
immediatly after I call the document.write in the parent function.
Firefox complains that the function in the child window "is not a
function". However, if I call that same child function later from
another event, it works fine. Any idea what would cause this? Here
is what I am doing in code:
var myWindow = null;
function show_new_win() {
var content = "some content";
if (myWindow==null) {
myWindow=window.open('','OrigFileWindow','width=1200,height=1200');
myWindow.document.write("<html><head><link type='text/css'
rel='stylesheet'
href='style.css'><script> function
mytest(id, pos){var newdiv =
document.getElementById(id);newdiv.className='highlightcnum';var
outerdiv = document.getElementById('innerfile');
outerdiv.scrollTop=pos; }<\/script></head><body >" + content + "</
body></html>");
}
myWindow.mytest("h_" + mycnum ,500);
}
Thanks for any insights.
}