强制页面进入框架 [英] Forcing page into frame

查看:73
本文介绍了强制页面进入框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我被要求在现有的网站上添加一些页面,这些网页是用框架完成的
(两套不同的套装)不同导航的框架

链接)。


我需要确保如果有人试图加载没有

的页面frameset它会强制框架集显示正确的

页面。


我已经将这个代码放在其中一个孩子的顶部页面:


< script language =" Javascript">


if(top.location == self.location){

top.location =''../../ index.htm.htm''

}

< / script>


这几乎可以正常工作,它可以正确打开框架集,但它始终是

显示框架集包含的原始文件。

怎么样?我强制它打开显示正确的页面?


问候,

Bernard D.

解决方案
1。你必须将要显示的页面的URL发送到

框架集(例如使用查询字符串),例如

''frameset.htm?uri = somepage.htm ''


2.如果传输了uri,框架集会弄清楚,如果是,

打开你喜欢的窗口。


micha


2005年5月4日03:23:40 -0700,micha < CH ********* @ web.de>写道:

1。你必须将要显示的页面的URL发送到
框架集(例如使用查询字符串),例如
''frameset.htm?uri = somepage.htm''

2。如果传送了uri,请设置框架集,如果是,则打开你喜欢的窗口。

micha




感谢Micha,


给了我一个起点。

然而,我怎么能将ULR转换为
$中的文本字符串b $ b框架集?


我知道如何在PHP中轻松完成它,但这个javascript的东西是

a对我来说有点模糊。


问候,

Bernard D


假设这是网址的样子:


HOST / PATHES / frameset.htm?uri = somepage.htm

window.location.search将提供?uri = somepage.htm


window.location.search.slice(5)提供somepage.htm


Hi,

I''ve been asked to add some pages to an existing web-site that was
done in frames (two different sets of frames with different navigation
links).

I need to ensure that if someone tries to load a page without the
frameset it will force the frameset to take effect with the correct
page displayed.

I''ve got this code at the top of one of the child pages:

<script language="Javascript">

if (top.location == self.location) {
top.location = ''../../index.htm.htm''
}
</script>

This almost works, it opens the frameset correctly, but it always
shows the original file that the frameset contains.
How can I force it to open with the correct page displayed?

Regards,
Bernard D.

解决方案

1. you have to transmit the url of the page to be displayed to the
frameset (using the querystring for example) like
''frameset.htm?uri=somepage.htm''

2. have the frameset figure out if a uri is transmitted, and if yes,
open it the window you like.

micha


On 4 May 2005 03:23:40 -0700, "micha" <ch*********@web.de> wrote:

1. you have to transmit the url of the page to be displayed to the
frameset (using the querystring for example) like
''frameset.htm?uri=somepage.htm''

2. have the frameset figure out if a uri is transmitted, and if yes,
open it the window you like.

micha



Thanks Micha,

that gives me a starting point.
However, how would I then convert the ULR into a text string within
the frameset?

I know how to do it in PHP easily enough, but this javascript stuff is
a bit obscure to me.

Regards,
Bernard D


suppose this is what the url looks like:

HOST/PATHES/frameset.htm?uri=somepage.htm

window.location.search will deliver ?uri=somepage.htm

window.location.search.slice(5) delivers somepage.htm


这篇关于强制页面进入框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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