Hi!! i tried no of time but why it display nothing i can't understand. please help me.
i think my request to call xml file is wrong.
how to make request to call xml file and then how to parse it?
here is my code for request
createView: function() {
this.controls.backbutton = new KONtx.control.BackButton({
label: "List of Films",
}).appendTo(this);
this.controls.label = new KONtx.element.Text({
styles: {
fontSize: KONtx.utility.scale(24),
vAlign: "center",
hAlign: "center",
color: "#FFFFFF"
},
}).appendTo(this);
var xmlDoc = new new XMLHttpRequest();
xmlDoc.autoRedirect = false;
xmlDoc.open( "GET", "http://www.myweb.com/demo/film/film.xml", true );
xmlDoc.send();
if (xmlDoc.status === 200)
{
this.parent();
this.controls.label.setText(this.persist.foo);
var xml = xmlDoc.responseXML,
oNames = xml.evaluate("//Title"),
oDescriptions = xml.evaluate("//ContentType"),
oLocations = xml.evaluate("//Duration"),
events = [];
for (var i = 0, len = oNames.length; i < len; i++)
{
this.parent();
this.controls.label.setText(this.persist.foo);
}
}
},
please help.. help. i am very confused. Thanks
by
3 Replies