发布于 2015-02-26 07:07:48
匿名者在评论中给出了正确的答案。
$("a").click(function(e){
var xml = $("textarea").text();
if(window.navigator && window.navigator.msSaveBlob){
e.preventDefault();
navigator.msSaveBlob( new Blob([xml], {type:'application/xml'}), "myfile.xml" )
} else {
$(this).attr("href", "data:application/xml," + encodeURIComponent(xml));
}
});https://stackoverflow.com/questions/28686843
复制相似问题