
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.69 KB | hits: 17 | expires: Never
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>
popup.document.open("text/xml", "replace");
popup.document.write(xml);
popup.document.execCommand('SaveAs',true,'file.xml');
popup.close();
});