更好的替代iframe? [英] Better alternative to an iframe?

查看:429
本文介绍了更好的替代iframe?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含iframe的网页,用于展示点击的标签的内容。有3个选项卡和1个iframe。与所点击的每个标签相关的内容的源被格式化并且在其他html& css文件。

I have a page with an iframe to feature the contents of the clicked tab. There are 3 tabs and 1 iframe. The sources of the contents relating to each tab clicked are formatted and coded in other html & css files.

使用iframe的另一个替代方法是,我注意到当选项卡被点击时,它仍然显示白色背景,类似于新页面正在加载?

What is another alternative to using an iframe, because I noticed that when the tab is clicked, it still shows the white background, similar to when a new page is loading?

这是我的代码:

<div id="tabs">
<div id="overview">
  <a target="tabsa" class="imagelink lookA" href="toframe.html">Overviews</a>
</div>
<div id="gallery">
  <a target="tabsa" class="imagelink lookA" href="tawagpinoygallery.html">Gallery</a>
</div>
<div id="reviews">
  <a target="tabsa" class="imagelink lookA" href="trframe.html">Reviews</a>
</div>
</div>

<div id="tabs-1">
  <iframe src="toframe.html" name= "tabsa" width="95%" height="100%" frameborder="0">
  </iframe>
</div>


推荐答案

使用IFRAME加载动态内容页面加载后)正在使用AJAX更新您的网页上的容器。

The only alternative to using IFRAMEs to load dynamic content (after the page has loaded) is using AJAX to update a container on your web page. It's pretty elegant and usually faster than loading a full page structure into an IFRAME.

  • Ajax with JQuery (use this and you will be loved on SO; the AJAX functions are great and simple)
  • Ajax with Prototype
  • Ajax with MooTools
  • Standalone Ajax with Matt Kruse's AJAX toolbox (Used to use this, using JQuery today because I needed a framework)
  • AJAX with Dojo (Said to be fast, but AJAX is not as straightforward)

这篇关于更好的替代iframe?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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