Forum Moderators: open
i posted a msg earlier about htis but somehow it diosappeared but here goes anyway..
I am trying to save a serialized svg dom node to an external file on the same location in MSIE.. i'd already implemented a loading functionality using getURL() which loads data from a file sucessfully, like so:
//*********loading from file
function loadAndParseFile(fileName) {
if(typeof(DOMParser) == 'undefined') {
getURL(fileName, fileLoaded);
function fileLoaded(data) {
var string = '';
if(data.success) {
string = data.content;
} else {
alert('Loading has failed!');
}
var node = parseXML(string, document);
canvas.appendChild(node);
}
}
else {
//handle browser compatibility problem here
alert("Browser not supported! Internet Explorer works fine!");
return '';
}
}
this has always worked fine! i tried to implement postURL() in the same way to save serialised dom fragments to the same file like so:
//****************saving*********
function serializeNode(node, fileName) {
if (typeof printNode != 'undefined') {
pathdata = printNode(node);
alert(pathdata);
}
else {
// might want to handle problem here
alert("Browser incompatibility, ues MSIE!");
return '';
}
postURL( fileName, pathdata, callback );
function callback( urlRequestStatus){
if(urlRequestStatus.success) {
alert('Saved Successfully!' + pathdata);
} else {
alert('Saving has failed!' + urlRequestStatus.content);
}
}
this sems to work fine, i get the message "Saved Successfully!" and no errors...but when i check the file, nothing is actually saved to it!
This is surely confusing & i have no idea what else to do, ive tried all sorts to no avail...any hlep please!
Recommend any better/easier ways of doing this if any1 can..
thanks