JavaScript中的window.location备选方案 [英] window.location alternatives in JavaScript

查看:78
本文介绍了JavaScript中的window.location备选方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

window.location.href 属性的标准替代品是什么?我正在检查w3schools.com它是否在所有主流浏览器中实现,所以没有问题,但我很好奇如何正确地做到这一点。

What is a standardized alternative to window.location.href property? I was checking on w3schools.com that it is implemented in all major browsers so there's no problem but I'm rather curious how to do that properly.

此处是函数未标准化的声明: https://developer.mozilla.org/en/DOM/window.location

From here is the statement that the function is not standardized: https://developer.mozilla.org/en/DOM/window.location

谢谢!

推荐答案

窗口对象可以追溯到Netscape 2.0中的原始JavaScript实现,并且从那时起,每个浏览器都存在 location

The window object goes back as far as the original JavaScript implementation in Netscape 2.0, and location has existed in every browser since then.

DOM之外的浏览器对象模型传统上没有标准化,但这会随HTML5而变化,HTML5会记录 窗口对象其<明确code> location 属性

The Browser Object Model outside of the DOM has tradionally not been standardised, but that changes with HTML5, which documents the window object and its location property explicitly.

这篇关于JavaScript中的window.location备选方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆