I have a web page in html5 that read an xml and display the info in there. The page is written in jquery.
This is my xml: xml
This is my html5: html
I can read perfectly the html5 (that was hard to me) but when I want to display it, I have to reload the page to see the info, because at first I see nothing! 🙁
Can someone help me please?
Thanks a lot!
p.s. I usually open it on firefox as safari and chrome do not open it. (I think because of my configuration)
var xml;
$(document).ready(function(){
$.ajax({
type: "GET",
url: "base_es.xml",
dataType: "xml",
success: xmlParser
});
});
//loading XML file and parsing to .main div.
function xmlParser(data) {
xml = data;
$('#load').fadeOut();
$(xml).find("fac").each(function () {
name = $(this).attr("id");
name2 = $(this).find("esc").text();
var curso = $(this).find("curso").text();
$("#list").append("<li><a href='hor3.html?id=" + name + "'data-transition='slide'><h3 id='name'>" + name + "</h3></a></li>");
}); $('#list').listview('refresh');
}
Ok, I have seen that I can reload the page with
location.reload();or withtop.location.href='hor2.html';