防止iframe加载“src”刷新页面 [英] Prevent iframe from loading "src" page upon refreshing

查看:905
本文介绍了防止iframe加载“src”刷新页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个静态网站,并使用iframe。问题是,当我导航到另一个页面时,例如说这个iframe代码:

 < iframe marginheight = 0align = top src =aboutus1.phpframeborder = 0 scrolling = no border = 0 WIDTH = 800 framespacing = 0 id =bodyframeidname =bodyframenameonLoad =autoResize('bodyframeid');>  >< / iframe中> 

src 属性指向aboutsus1。 PHP。现在,当我导航到另一个页面时,例如,我转到aboutus2.php,然后重新加载页面,它返回到aboutus1.php,由 src =aboutus1.php。我的问题是,即使重新加载页面,我该如何留在当前页面(aboutus2.php)?



编辑:
点击此处查看实例



点击上面的链接。您将看到的第一页是关于CTI 。现在,请点击合作伙伴菜单,然后刷新页面。它回到关于CTI 页面。当页面重新加载时,我该如何防止它回到关于CTI 页面?

解决方案 div>

您可以将当前页面位置存储在会话中,并在重新加载时加载存储在会话中的URL。但是你需要一些服务器端技术。在只是HTML你不存储的东西。您可能也可以使用GET值。


I'm creating a static website and I am using iframes. The problem is, when I navigate to another page, say for example, this code for the iframe:

<iframe marginheight="0" align=top src="aboutus1.php" frameborder=0 scrolling=no border=0 WIDTH=800  framespacing=0 id="bodyframeid" name="bodyframename" onLoad="autoResize('bodyframeid');>" ></iframe>

The src attribute is pointing to aboutsus1.php. Now, when I navigate to another page, for example, I go to aboutus2.php then I reload the page, it goes back to aboutus1.php which is executed by src="aboutus1.php". My question is, how do I stay on the current page (aboutus2.php) even if I reload the page?

EDIT: Click here for live example

Click the link above. First page you will see is About CTI. Now, try clicking on Partners menu then refresh the page. It goes back to About CTI page. How do I prevent it from going back to About CTI page when the page reload?

解决方案

You could store the current page location in a session, and on reload load the url stored in the session. But you'd need some server side technology. In just html you don't store things. You might also be able to use a GET value.

这篇关于防止iframe加载“src”刷新页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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