Currently am using the following code to print access my script content which is actually a xml.. We are enclosing it in script since we want this functionality to be working on ie11.
<script id="cus" type="application/xml">
<firstname></firstname>
<lastname></lastname>
</script>
Now , I am using the following code to create a xml doc ..
var parser = new DOMParser();
var formID = "cus";
doc = parser.parseFromString(document.getElementById(formID).innerHTML, "application/xml");
// here is the some code where am changing the doc ..
x=doc.getElementsByTagName(fieldID);
for(i=0;i<x.length;i++)
{
doc.getElementsByTagName(fieldID)[i].setAttribute(attrName,value);
}
// after changing the doc , i want it to update my script tag with the content.
Is there any way to print the xml in doc .. or is there any way to update innerHtml to the changed xml in doc .
Please help
No comments:
Post a Comment