vikrampschauhan
January 25th, 2005, 07:29 PM
I believe objects in Javascript are essemtially the same as objects in C#(or Java).
For eg, I have a code snippet:
var xml=new ActiveXObject("Microsoft.XMLDOM");
xml.async=false;
xml.load("autoBody.xml");
var xsl=new ActiveXObject("Microsoft.XMLDOM");
xsl.async=false;
xsl.load("autoBody1.xsl");
document.write("<center>"+xml.transformNode(xsl)+"</center>");
Here, when we say:
var xml=new ActiveXObject("Microsoft.XMLDOM");
an object of the ActiveXObject class is allocated on the heap and its reference is given to xml.
(We have declared xml as a var, we could have said:
ActiveXObject xml=new ActiveXObject("Microsoft.XMLDOM"); instead of declaring it simply a var, and its type would be determined at runtime).
Now, the object that variable xml refers to contains the public data member async
and the method load(these members are called later using: xml.async=false;
xml.load("autoBody.xml"); ).
Is my interpretation of the functionality correct here?
This would mean that Javascript is an object oriented language.
I believe VBScript is also object oriented?
Thanks
Vikram
For eg, I have a code snippet:
var xml=new ActiveXObject("Microsoft.XMLDOM");
xml.async=false;
xml.load("autoBody.xml");
var xsl=new ActiveXObject("Microsoft.XMLDOM");
xsl.async=false;
xsl.load("autoBody1.xsl");
document.write("<center>"+xml.transformNode(xsl)+"</center>");
Here, when we say:
var xml=new ActiveXObject("Microsoft.XMLDOM");
an object of the ActiveXObject class is allocated on the heap and its reference is given to xml.
(We have declared xml as a var, we could have said:
ActiveXObject xml=new ActiveXObject("Microsoft.XMLDOM"); instead of declaring it simply a var, and its type would be determined at runtime).
Now, the object that variable xml refers to contains the public data member async
and the method load(these members are called later using: xml.async=false;
xml.load("autoBody.xml"); ).
Is my interpretation of the functionality correct here?
This would mean that Javascript is an object oriented language.
I believe VBScript is also object oriented?
Thanks
Vikram