0

How to parse an xml from javascript from code beside page? i have tried

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = false;
        xmlDoc.onreadystatechange = Readxml;
        xmlDoc.load("abc.xml");

but the error is that the xml is not loaded? i am using visual studio 2008.thnks in advance

2
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by sahmed_12
0

though i have solved the problem of loading, what if i want to load an xml present in C:. how to give the path?

0

finally i have solved it. The solution is

xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async = false;
        var path = document.location.href;
        path = path.replace(/\\/g,"/");
        path = path.substr(0,path.lastIndexOf("/")+1);
        var path=path+"folder/filename";

This made my code work

0

Hello.

I want to take data (xml file) from my c: drive and want to parse it.....
Can you plz tell me how to do that???

Thanks

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.