在Firefox的iframe中加载页面时出现问题

在Firefox的iframe中加载页面时出现问题,firefox,iframe,Firefox,Iframe,我有一个包含iFrame的aspx页面,我在页面加载事件中设置了这个iFrame的src属性 加载到iFrame中的页面有自己对自己的样式表和javascript文件的引用,但是当页面加载时,它会尝试使用父页面的路径来定位这些文件 示例结构: /应用程序/example/parentpage.aspx /应用程序/iframepages/iframepage.html /应用程序/iframepages/css/iframepagecss.css /应用程序/iframepages/script

我有一个包含iFrame的aspx页面,我在页面加载事件中设置了这个iFrame的src属性

加载到iFrame中的页面有自己对自己的样式表和javascript文件的引用,但是当页面加载时,它会尝试使用父页面的路径来定位这些文件

示例结构:

/应用程序/example/parentpage.aspx

/应用程序/iframepages/iframepage.html

/应用程序/iframepages/css/iframepagecss.css

/应用程序/iframepages/scripts/iframepagescript.js

使用包含以下行的iframepage.html:

link rel=“stylesheet”href=“css/iframepage.css”type=“text/css”

script type=“text/javascript”language=“javascript”src=“scripts/iframepagescript.js”

问题似乎是当iframepage.html加载到parentpage.aspx上的iframe中时,它尝试从路径application/example/css/iframepagecss.css加载css文件,同样,对于javascript,它尝试从application/example/scripts/iframepagescript.js加载css文件

这只发生在Firefox中,它在IE、Chrome和Safari中运行良好。想法

提前感谢。

查看后,您可以尝试使用标记,或者使用绝对路径