I am trying to bind xmlData into jsTree but the data is not being populated into jsTree (other than Mozila firefox).
jsTree is populated with sample data in Mozila firefox but not in other browser
What have I missed in following code?
jsTreeDemo.html file:
<html>
<head>
<title>Use jsTree</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="jquery.jstree.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$.ajax({
type: "GET",
url: "Employees_xml_flat.xml",
dataType: "text",
success: function(xmlData) {
$("#treeViewDiv").jstree({
"xml_data" : {
"data" : xmlData
},
"plugins" : [ "themes", "xml_data" ]
});
}
});
});
</script>
</head>
<body>
Sample xml file as follows:
<root> <item id="4" parent_id="0" state="open"> <content><name><![CDATA[Charles Madigen]]></name></content> </item> <item id="192" parent_id="4"> <content><name><![CDATA[Ralph Brogan]]></name></content> </item> <item id="295" parent_id="192"> <content><name><![CDATA[Bhushan Sambhus]]></name></content> </item> <item id="294" parent_id="192"> <content><name><![CDATA[Betsy Rosenbaum]]></name></content> </item> </root>
**Mozila firefox version 11.0 ** : jsTree populated well
**Internet explorer version IE8 **:
Google Chrome version 18.0.1025.162 m ** : Nothing is display :: Error coming on console **XMLHttpRequest cannot load file:///C:/Users/VaibhaV/JsTreeDemo/files/Employees_xml_flat.xml. Origin null is not allowed by Access-Control-Allow-Origin.
Browser compatibility issue? Code issue? Xml format issue ?
Any help or guidance in this matter would be appreciated.