I have to create a module in a specific project, which already uses PrototypeJS.
What I have: - An XML File with information
What I want: - A simple div, which displays the (with XPath filterd) Content of the XML-File.
I am complete new to PrototypeJS and dont know where to begin, so I appreciate your help.
Blessing chris
If by "local" you mean "client-side", you will have to :
edit: to clarify the fetch part, here is how you can do it using Prototype:
new Ajax.Request('myfile.xml', {
onSuccess: function(transport) {
myParseXml(transport.responseXML);
},
onFailure: function(transport) {
alert('Failure! Status code '+transport.status+' ('+transport.statusText+')');
}
);
function myParseXml(xmlDoc) {
var root = xmlDoc.documentElement;
...
}
Try:
<xml src="MyData.xml" id="mydata" >
var mydata = document.getElementById('mydata');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.