English 中文(简体)
页面独立负载, 但挂在其它页面下的 Iframe 中
原标题:Page loads standalone but hangs in iframe under other page

此页面 < a href=> "http://pagelinks.mxhoste.com/readings_page.php" rel="nofollow" >http://pagelinks.mxhoste.com/readings_page.php 如果您在浏览器中键入地址, 则该页面将独立装载。 但如果我以 .load () 装入另一页的 iframe, 它会挂挂 :

这里是""http://pagelinks.mxhoste.com/readings.php" rel="nofollow">http://pagelinks.mxhoste.com/readings.php ,我有一个装入页面的框架。

<iframe src="readings_page.php" scrolling="no" style="position: relative; top:-25px; width:97.5%; height:95.2%; border:10px solid #404040; overflow:hidden;"></iframe>
<script>
    document.title = "PageLinks | Daily Readings";
    $("#menu ul li").removeClass("active");
    $("#menu ul li:eq(1)").addClass("active");
    show_alerts();
</script>

该代码本身也自动在浏览器中加载该代码。它只有当我在单击一个按钮时将文件装入另一个页面元素时挂挂

$(#page).load( readings.php );

这是用于此元素的 html :

<div id="page"> 

</div> 
<style>
#page {
    font-family:"Arial", Helvetica, sans-serif;
    font-size:0.8em;
    width: 778px;
    height: 435px;
    padding-top: 0px;
    padding-left: 0px;
    padding-right: 0px;
    background-color: #404040;
    margin: 0 auto;
    position: relative;
    top: 30px;
}
</style>

是否有另一种方式可以装载读数. php 来解决这个问题? 换句话说, 将页面读数_ page. php 装入我主页上的 div 中的最佳方式是什么 。 我用 Irame 挂挂挂的方法 。

问题回答

当 DOM 准备好时, 在您的读数中装入您的读数_ page.php :

$(document).ready(function(){
  // DOM is ready now
  $(#page).load( readings.php );
});

如果框架仅在用户执行动作后才需要显示,请在页面加载时考虑装入内容(并在页面加载时隐藏框架或包含框架的迪夫)。

如果您需要在页面加载后立即看到, 那么我建议您在发送前尝试将您在服务器一侧的两页的源头合并起来, 而不是让用户浏览器单独提出 HTTP 请求 。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签