Hi,

I need xml data to be used in javascript.
When I embed the whole xml in html page then I am able to access xml.
But when when I use src tag I am unable to get xml file.

Code is below:
XML Data island in html page.

<xml id="xmlId" src="filters.xml" ></xml>

Code to access xml:

var xml = document.getElementById("xmlId");
        var xmlDocument = xml.XMLDocument;
        alert(xmlDocument.xml);

Can anyone please tell me why I am not able to get xml file by using src attribute in XML data island.

I tried exactly what you posted and it works fine for me. Here is something else I tried:
http://articles.sitepoint.com/article/xml-data-source-object/

(specifically refer to page 2) and it also works for me. I suspect your problems are all tied to security permissions. If that is the case, I suspect that even that other approach will not work for you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.