August 24, 2009

0 Loading XML Text into the Browser

Internet Explorer supports two ways of loading XML into a document object: the load( )
method and the loadXML( ) method. The load( ) method loads an XML file and the loadXML( ) method loads a text string that contains XML code.

The following code loads that a text string into Microsoft's XML parser:

<script type="text/javascript">
var txt= "<note>"
var = txt + "<to>Rasik</to><from>Bapotra<from>"
txt = txt + "<heading>Reminder</heading>"
txt = txt + "<body>Don't forget me this weekend!</body>"
txt = txt + "</note>"
var xmldoc=new ActiveXObject("Microsoft.XMLDOM")
xmlDoc.async= "false"
document.write("The first child elment in the txt contains: " +
document.write(" br / >" )
document.write("The second child element in the text contains: " +


Post a Comment

Blogger Themes

Powered by Blogger