sIFR 在所有 javascript 执行完毕后才显示?
我在加载到 iframe 的页面上使用 sIFR,并在父窗口中使用 javascript,不断轮询 iframe 以查看它何时更改高度(即,当您单击 iframe 页面中的链接时,它有一个与上一页的高度不同)。无论如何,问题是 sIFR 似乎不会显示渲染的文本,直到整个页面/脚本执行完毕,因此当页面首次加载并且 javascript 等待 iframe 更改高度时,没有文本。然而,一旦 iframe 改变高度(即,我单击 iframe 内的链接),javascript 就会完成并显示 sIFR 渲染的文本。有没有办法允许 sIFR 在页面/脚本完成运行之前渲染?
I am using sIFR on a page which I am loading into an iframe, and using a javascript in the parent window which constantly polls the iframe to see when it changes height (ie. when you click a link in the iframe page and it has a different height than the previous page). Anyways, the problem is that sIFR doesn't seem to show the rendered text until the entire page/script has executed so when the page is first loaded and the javascript is waiting for the iframe to change height, there is no text. As soon as the iframe changes height however (ie. I click a link within the iframe), the javascript finishes and the sIFR rendered text shows up. Is there a way to allow sIFR to render before the page/scripts have finished running?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先将 sifr js 和 css 放在
中,然后放在其他 css 和 js 文件之前
Put you sifr js and css first of all in
<head>
before other css and js files正如 Jitendra 提到的,首先加载文件会有所帮助。您还可以查看检测 CSS 负载。
As Jitendra mentioned, loading the files first will help a bit. You can also look into Detecting CSS load.