在src属性中没有加载Firefox的iframe iframe

时间:2012-09-27 16:55:29

标签: firefox iframe

以下iframe将显示在除Firefox之外的所有浏览器中。任何有关原因的见解?

<iframe src="http://sitename.com/directory/#pagename/"></iframe>

1 个答案:

答案 0 :(得分:0)

问题在于firefox做了一些url解码或者查看window.location.hash而不是window.location.href。 url中的哈希值是为了正确加载iframe所需的url部分。

将src属性更改为http://sitename.com/directory#pagename/解决了这个问题。