window.location.href不适用于IE9

时间:2013-04-05 13:05:01

标签: javascript html internet-explorer-9 window.location

您好我使用以下代码保存画布。

var img = canvas.toDataURL("image/png").replace("image/png", "image/octet-stream");
window.location.href = img;  

但IE9不起作用。无法打开数据:image / octet-stream; base64,iVBORw0KGgoAAAANSUhEUgAAB4AAA .....

如何让它在IE9上运行? 谢谢你的帮助...

1 个答案:

答案 0 :(得分:0)

可能会尝试使用

window.location.assign(img); // or
window.location = img;

有关详情,请查看window.location

相关问题