window.location.href在谷歌中可以使用,但是在IE中不能使用。
var browser = navigator.userAgent;
if (browser.indexOf("Chrome") != -1 || browser.indexOf("Firefox") != -1)
top. window.location= '<%=request.getAttribute("url")%>';
// top.window.location = 'orders/orders!createOrders';
else
top.window.location = '../'+'<%=request.getAttribute("url")%>';
// top.window.location = '../orders/orders!createOrders';
本文介绍了一种在不同浏览器间实现窗口跳转的方法。通过检测当前浏览器类型(Chrome或Firefox等),并根据检测结果调整window.location.href的使用方式,确保在IE和其他现代浏览器中都能正确导航到指定页面。
3895

被折叠的 条评论
为什么被折叠?



