here's the code (running from an ASP page):
<script language = "JavaScript " type="text/javascript">
function initStuff() {
var scanWindow = window.open('sc anning.htm', 'scanning',
'status=yes,hei ght=200,width=4 50,top=10,left= 10,scrollbars=y es');
}
function updatestats (icount,smessag e,iupdate,tcoun t) {
//var scanStatus = scanWindow.docu ment.form1;
alert('scanWind owCheck sc=
['+scanWindow.do cument.form1.sc anWindowCheck.v alue + ']');
var objscan = scanWindow.docu ment.form1 ;
if (iupdate == "doc") {
objscan.getElem entById("docsta ts").value = icount ;
}
if (iupdate == "fld") {
objscan.getElem entById("fldsta ts").value = icount ;
}
objscan.getElem entById("mess") .value=smessage ;
objscan.getElem entById("total" ).value=tcount;
}
</script>
initStuff is called after the <body> tag, there is then a loop to give
'scanWindow' time to load and render (this runs from server side to
prevent any load on the client).
updatestats, on first call, gives out "scanWindow is undefined" as it
tries to fire the alert box.
Previously I had an alert that looked for the field value of a small form
on the page, that is updated from the popup. This appears to change
correctly when the popup has rendered its own form (form1 in this
context).
what's going wrong?
<script language = "JavaScript " type="text/javascript">
function initStuff() {
var scanWindow = window.open('sc anning.htm', 'scanning',
'status=yes,hei ght=200,width=4 50,top=10,left= 10,scrollbars=y es');
}
function updatestats (icount,smessag e,iupdate,tcoun t) {
//var scanStatus = scanWindow.docu ment.form1;
alert('scanWind owCheck sc=
['+scanWindow.do cument.form1.sc anWindowCheck.v alue + ']');
var objscan = scanWindow.docu ment.form1 ;
if (iupdate == "doc") {
objscan.getElem entById("docsta ts").value = icount ;
}
if (iupdate == "fld") {
objscan.getElem entById("fldsta ts").value = icount ;
}
objscan.getElem entById("mess") .value=smessage ;
objscan.getElem entById("total" ).value=tcount;
}
</script>
initStuff is called after the <body> tag, there is then a loop to give
'scanWindow' time to load and render (this runs from server side to
prevent any load on the client).
updatestats, on first call, gives out "scanWindow is undefined" as it
tries to fire the alert box.
Previously I had an alert that looked for the field value of a small form
on the page, that is updated from the popup. This appears to change
correctly when the popup has rendered its own form (form1 in this
context).
what's going wrong?
Comment