what i am doing is:
reading a xml file with ajax get method
and then updating a particular node value of xml
- after updating this xml response i am posting it to the server side (php) for writing that xml file again
i am getting error in posting the updated xml response to server side the error is: NS_ERROR_XPC_BAD_CONVERT_JS: Could not convert JavaScript argument
i found this accepted answer but this didn't work for me: How to change the value of an xml node with jquery?
here is my somecode:
$.ajax({
url: "<?php echo $xmlFilePath;?>",
type: "GET",
dataType: "xml",
success: function(xml){
$(xml).find("Page[id='1']").each(function(){
$(this).find('ContentOne').text("New Value");
});
$.post('<?php echo base_url(); ?>contentadd', { xml: escape($(xml))}, function(data){alert("Data Loaded: " + data);});
}
});
any quick response will be helpfull