javascript - jquery, save entire DOM for reloading -
javascript - jquery, save entire DOM for reloading -
<!doctype html> <html lang="en-us"> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(function(){ var xml = '<?xml version="1.0"?><foo><bar>bar</bar></foo>'; document.open("text/xml", "replace"); document.write(xml); document.execcommand('saveas',true,'file.xml'); }); </script> </head> <body> </body> </html>
this html-file generates xml file (in ie) , creates "save as" dialog. however, reset document previous state (before "replace") after have saved file. possible using pure javascript or jquery? thanks
run code against document
<iframe>
instead of replacing current document.
javascript jquery xml dom
Comments
Post a Comment