javascript - URL 重定向和重新加载在 Safari 和 IE 中不起作用
问题描述
我正在使用以下方法重定向到Item
页面并重新加载整个页面。适用于所有浏览器,但 Safari 和 IE(一如既往!)。在这两个中,当前页面被重新加载。
有关如何以不同方式进行操作的任何建议?
<a href="/items/{{item.$id}}" onclick="location.reload()" class="btn">Item</a>
我在JS中也试过如下,但在Safari和IE中也出现同样的问题
$scope.redirect = function(Item) {
window.location.href = '/items/' + item.$id;
window.location.reload();
}
解决方案
尝试这个:
$(document).ready(function(){
// put all your js inside it
init();
});
也尝试通过禁用缓存参数
推荐阅读
- r - 合并不同大小的数据框,但列返回“NA”
- sql - 我想我计算每个仓库的总收入是错误的
- cloud - 在使用 Lite 计划(免费)创建云对象存储时,不断收到错误,即经销商渠道 ID 不适用于计划
- node.js - 如何调节查询主体以了解它是否具有文件字段
- java - 以事务方式写入文件
- node.js - 使用 multer 快速上传多个文件
- swift - SwiftUI .onDelete 在 TabView 中不起作用,因为 View 总是在变化
- azure - 错误:Azure AD 身份验证 Web 应用程序中的内部服务器错误部署为 Azure Web 应用程序服务中的 docker 容器
- javascript - 如何将我的域名扩展名从cars.net 更改为cars.com?
- macos - NSSavePanel“字符串”?