gpt4 book ai didi

javascript - IE8 中的 window.location.href 轻弹

转载 作者:行者123 更新时间:2023-11-28 10:06:42 25 4
gpt4 key购买 nike

我正在使用 window.location.href('URL'); 使用 javascript 打开 Excel 文件

它在 Firefox、Safari 中工作正常,但在 IE8 中它显示一个空白屏幕,然后显示一个文件对话框。 IE 出现什么问题?

最佳答案

改为在 iFrame 中打开它。

<iframe name="hiddenframe" style="display:none"></iframe>

你的JS将是:

hiddenframe.src = "myexcelfile.xlsx";

关于javascript - IE8 中的 window.location.href 轻弹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8209372/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com