I have small requirement that i want to read text area rows and need to display it like xml format.I tried with following code, it successfully gives the alert with xml structure. But here I would like to show the entire xml data in separate HTML file with xml data, Once we click on submit button whole the xml data wants to display some other page Please help. I tried with following code,
var url= "url";
var urlValues;
$(document).ready(function(){
$("#saveImgID").click(function(){
var xmlStart = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><Rowsets>";
var xmlEnd = "</Rowset></Rowsets>";
var lines = $('#fileContent1').val().split(/\n/);
var texts = []
for (var i=0; i < lines.length; i++) {
if (/\S/.test(lines[i])) {
texts.push($.trim(lines[i]));
}
}
xml += xmlEnd;
xmlData = xml;
urlValues = url+"?importData="+xmlData;
window.location.href=urlValues;
});
});
Here is the fiddle