store xml node in sessionStorage
Hello,
i read the data from xml document.
I want to store the variable "area" into "javascript:sessionStorage...", to transfer the value to the next html site.
But it doesn't work. I've heard that's important to serialize the xml data to string and unserialize the string to xml.
I know json is the better format to read out and transfer data for jQuery Mobile, but I want to use the xml-format.
Can someone help me to serialize the area node?
Here is the javascript code:
- $("#page1").on('pageshow', function () {
$("#output_page1").empty();
$.ajax({
type: "GET",
url: "output.xml",
dataType: "xml",
success: parseXml
});
function parseXml(xml) {
$(xml).find("project").each(function()
{
$(this).find("area").each(function(i,item)
{
var area = $(this).attr("title");
$("#output_page1").append("<li><a href='page1_details1.html' data- transition='slide' onClick='javascript:sessionStorage.type=\''+area+'\';'>"+ area + "</a></li>");
});
});
$("#output_page1").listview("refresh");
}
});