473,480 Members | 2,277 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

object undefined - problem

here's the code (running from an ASP page):
<script language = "JavaScript" type="text/javascript">
function initStuff() {
var scanWindow = window.open('scanning.htm', 'scanning',
'status=yes,height=200,width=450,top=10,left=10,sc rollbars=yes');
}
function updatestats (icount,smessage,iupdate,tcount) {
//var scanStatus = scanWindow.document.form1;
alert('scanWindowCheck sc=
['+scanWindow.document.form1.scanWindowCheck.value + ']');
var objscan = scanWindow.document.form1 ;
if (iupdate == "doc") {
objscan.getElementById("docstats").value = icount ;
}
if (iupdate == "fld") {
objscan.getElementById("fldstats").value = icount ;
}
objscan.getElementById("mess").value=smessage;
objscan.getElementById("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?
Jul 23 '05 #1
1 2188
"s_m_b" <sm********@hotmail.com> wrote in
news:Xn**********************************@216.196. 97.138:
here's the code (running from an ASP page):
<script language = "JavaScript" type="text/javascript">
function initStuff() {
var scanWindow = window.open('scanning.htm', 'scanning',
'status=yes,height=200,width=450,top=10,left=10,sc rollbars=yes');
}
function updatestats (icount,smessage,iupdate,tcount) {
//var scanStatus = scanWindow.document.form1;
alert('scanWindowCheck sc=
['+scanWindow.document.form1.scanWindowCheck.value + ']');
var objscan = scanWindow.document.form1 ;
if (iupdate == "doc") {
objscan.getElementById("docstats").value = icount ;
}
if (iupdate == "fld") {
objscan.getElementById("fldstats").value = icount ;
}
objscan.getElementById("mess").value=smessage;
objscan.getElementById("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?


solved it - misunderstood the previous instructions about using a object
reference, so had the initStuff function return an object and its fine now!
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3120
by: Peter Nofelt | last post by:
Hey all, I am running into an issue. My situation is that I wish to copy the contents of one listbox to an array, sort it by innerText value, and write the sorted options into a new listbox. ...
30
3687
by: jimjim | last post by:
Hello, This is a simple question for you all, I guess . int main(){ double *g= new double; *g = 9; delete g; cout<< sizeof(g)<<" "<<sizeof(double)<<" "<<sizeof(*g)<<" "<<*g<<" "<<endl; *g =...
2
2202
by: JRoe | last post by:
Hello, I am beside myself with this problem. I need to access unmanged C++ code in a C# environment. I have created a managed C++ wrapper that wraps the unmanaged class. When I call the...
11
3791
by: Kevin Prichard | last post by:
Hi all, I've recently been following the object-oriented techiques discussed here and have been testing them for use in a web application. There is problem that I'd like to discuss with you...
26
5629
by: yb | last post by:
Hi, Is there a standard for the global 'window' object in browsers? For example, it supports methods such as setInterval and clearInterval, and several others. I know that w3c standardized...
7
22099
by: Ike | last post by:
Can someone please illuminate to me why, in the following snippet of script, the alert statement in the try-catch gives me ? The file 'http://localhost:1222/roomx1/getdata.php' truly does exist....
5
2906
by: removeps-generic | last post by:
Hi. I'm using placement new to re-initialize part of an object. Is this OK? struct BaseImp { All& r_all; BaseImp(All& all) : r_all(all) }; struct Calc::Imp : public BaseImp
21
1873
by: Andrew Ward | last post by:
Consider the following: #include <iostream> struct X { int x; X() { x = 6; } };
44
3307
by: petermichaux | last post by:
Hi, I have been using the following line of code to create an object called "Serious" if it doesn't already exist. if (Serious == null) {var Serious = {};} This works in the scripts I use...
9
2446
by: ziman137 | last post by:
Hi all, The results from following codes got me a bit confused. #include <stdio.h> #include <iostream> using namespace std; struct A {
0
7048
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6911
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7091
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6743
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6966
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5344
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
2988
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
185
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.