Z
zlarson
I have a website where a div's innerHTML is replaced with a string:
<input type="button" name="myButton" id="myButton"
onClick="printReport();"><IFRAME name="myFrame" id="myFrame"></IFRAME>
which holds a report. when the button is clicked it calls a function
to print the IFRAME:
function printReport()
{
if(document.getElementById('myFrame')){
if (navigator.appName.toUpperCase() == 'MICROSOFT
INTERNET
EXPLORER'){
document.myFrame.focus();
document.myFrame.print();
}else{
window.frames['myFrame'].print();
}
}
}
when the user gets to this report they can print it the first time, but
if they get another item and try to come back and print its report the
print button fails. i have put in alerts before and after the
window.frames['myFrame'].print(); and it hits both of them. keep in
mind this page is all using xmlHttpRequest and I have one big "load
div" where its innerHtml is constantly being replaced with remote html
strings. i first thought maybe i was ending up with multiple objects
with the same ID name both i watched the DOM with the Firefox tool and
that is not the case. The is only failing in Firefox. all is well in
IE. Thanks.
<input type="button" name="myButton" id="myButton"
onClick="printReport();"><IFRAME name="myFrame" id="myFrame"></IFRAME>
which holds a report. when the button is clicked it calls a function
to print the IFRAME:
function printReport()
{
if(document.getElementById('myFrame')){
if (navigator.appName.toUpperCase() == 'MICROSOFT
INTERNET
EXPLORER'){
document.myFrame.focus();
document.myFrame.print();
}else{
window.frames['myFrame'].print();
}
}
}
when the user gets to this report they can print it the first time, but
if they get another item and try to come back and print its report the
print button fails. i have put in alerts before and after the
window.frames['myFrame'].print(); and it hits both of them. keep in
mind this page is all using xmlHttpRequest and I have one big "load
div" where its innerHtml is constantly being replaced with remote html
strings. i first thought maybe i was ending up with multiple objects
with the same ID name both i watched the DOM with the Firefox tool and
that is not the case. The is only failing in Firefox. all is well in
IE. Thanks.