top.frames [1] .location.href无效:在运行时获取帧名称 [英] top.frames[1].location.href not working: fetch frame name during runtime

查看:115
本文介绍了top.frames [1] .location.href无效:在运行时获取帧名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我的帧.html页面分为标题和客户端框架,在我的客户端框架中,我正在加载client.html页面,这个客户端.html分为多个框架,当我点击client.html中的任何链接时,它应该加载客户端框架中的链接的url ,相应的链接位于client.html中的框架,


因此我使用


top.frames [1] .location.href = link_url;

这是行不通的


但如果我使用

top.frames [" framename" ;] = link_url

它工作正常


i想要使用这个名字,请问有人帮我吗?

Hi All
My" Frame .html " page is divided in to header and client frames and in my client frame i am loading "client.html" page, and this client .html is divided in to multiple frames,

when i click any on link in the client.html,it should load the url of the link in the client frame, ir respective of the frame in which the link resides in the client.html,

hence i used

top.frames[1].location.href=link_url;
this is not working

But if i use
top.frames["framename"]=link_url
it works fine

i don want to use the name, can any one help me please?

推荐答案

根据 w3schools ,它会仅返回命名帧的引用。因此,如果页面的第二个框架没有任何名称,则不会返回 frames [1]
According to w3schools, it would return references of the named frame only. So if the second frame of your page doesn''t have any name, it won''t be returned with frames[1].

我已将我的框架命名为CLIENT,尽管我使用了

top.frames [1] .location.href = link_url;我得到了对象预期的错误,我在行top.frames [1] .location.href usig alert之前检查了window.frames.length,并且返回了1,但我预计会超过2,因为我的


我的帧.html页面分为标题和客户端框架,在我的客户端框架中,我正在加载client.html页面,这个客户端.html分为多个框架,


i了解发生了什么,我期待你的建议:)
i have named my frame, as CLIENT eventhough if i use
top.frames[1].location.href=link_url; i am getting object expected error, and i checked window.frames.length before the line top.frames[1].location.href usig alert, and that retured 1, but i expected more than 2, since my

My" Frame .html " page is divided in to header and client frames and in my client frame i am loading "client.html" page, and this client .html is divided in to multiple frames,

i don understand what is happening, i am expecting your advice :)


发布您的HTML框架代码。另外,请查看此链接
Post your HTML frame code. Also, have a look at this link.


这篇关于top.frames [1] .location.href无效:在运行时获取帧名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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