I'm experiencing some strange behaviour with HTML embedded controls.
I use the following code:
<object id=myControl classid=<input type='button' name='go' onclick='RunControl()' Value='Submit'>
<script language="JavaScript">
function RunControl()
{
myControl.value = 10;
alert(myControl.value);
myControl.go();
}
</script>
The control has one property (value) and one method (go).
On my development machine: when I run the page, the control is downloaded correctly. When the button is clicked, the RunControl function is executed. I am able to set the property to the value 10, and read it back (using the alert(myControl.value)). I am also able to execute the .go() method (which by the way does a msgbox("Hello World"), which is displayed on the screen).
This is not the result that I get when testing on another XME machine!
My development machine (XME) has VS.NET 2003 on it. When I run the page from a regular XME machine (i.e. no VS.NET03) I get an error when the execution reaches the myControl.go(); line. It says: "Object doesn't support this property or method". It is able to set value and read it back correctly though. The "Object doesn't support this property or method" error is only encountered when testing on the XME machine that does not have VS.NET03. I then installed VS.NET03 on that machine, and sure enough the problem went away, and I was able to execute the page correctly. I finally removed VS.NET03 from that machine, and the problem came back. It seems that VS.NET03 is installing something on the machine that is needed by the above code, but I'm unsure as to what it is!
Have you seen something like this before? Does it have to do something with JavaScript?
Nai
I use the following code:
<object id=myControl classid=<input type='button' name='go' onclick='RunControl()' Value='Submit'>
<script language="JavaScript">
function RunControl()
{
myControl.value = 10;
alert(myControl.value);
myControl.go();
}
</script>
The control has one property (value) and one method (go).
On my development machine: when I run the page, the control is downloaded correctly. When the button is clicked, the RunControl function is executed. I am able to set the property to the value 10, and read it back (using the alert(myControl.value)). I am also able to execute the .go() method (which by the way does a msgbox("Hello World"), which is displayed on the screen).
This is not the result that I get when testing on another XME machine!
My development machine (XME) has VS.NET 2003 on it. When I run the page from a regular XME machine (i.e. no VS.NET03) I get an error when the execution reaches the myControl.go(); line. It says: "Object doesn't support this property or method". It is able to set value and read it back correctly though. The "Object doesn't support this property or method" error is only encountered when testing on the XME machine that does not have VS.NET03. I then installed VS.NET03 on that machine, and sure enough the problem went away, and I was able to execute the page correctly. I finally removed VS.NET03 from that machine, and the problem came back. It seems that VS.NET03 is installing something on the machine that is needed by the above code, but I'm unsure as to what it is!
Have you seen something like this before? Does it have to do something with JavaScript?
Nai