473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Determining frame's name

Hello,

Firstly, I'm not good at JS, so please be patient :)

I have a quite complicated page structure, where a lot of frames are
created dynamically (same applies to their names). How can I make each
of these frames print itself's name e.g. using alert? I know the name
of the parent frame, and I can include any js in each dynamically
created frame's header.

I've tried using self.name, window.name... but I always get "undefined"
result. Any suggestions?

Audrius

Sep 1 '05 #1
5 11966
In fact self.name and window.name dosn't work with IE... Using firefox
everything works fine. I can get frame's name using self.name.

Does anyone has any idea how to determine frame's name using IE ?

Thanks,
Audrius

Sep 1 '05 #2


Audrius wrote:

I have a quite complicated page structure, where a lot of frames are
created dynamically (same applies to their names).


What exactly are you trying to use to create a frame dynamically?
var iframe = document.createElement('iframe');
iframe.name = 'someName'
It is known that for IE/Win that fails to give the created element a
name attribute.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 1 '05 #3
Thanks for your reply.

I'm not creating frames myself. And I don't have any impact on their
creation (thus I can't select a frame name I want to use). I can only
affect the contents of those created frames, by executing my code in
them, which is actually generated with JSP (in this case it doesn't
matter).

I have a header frame... It's a place which I intend to change to add a
registry for those frames. Header frame is static and is used to hold
"global" variables or values... (I can change header's js)... So each
frame content should have a function that places it's name in header.
That's what I want to acomplish. To register all frames in header. And
to do that I need to determine frame's name on rendering. As I said, in
Firefox I can get it using self.name. With IE it doesn't work for me.

Thanks,
Audrius

Sep 1 '05 #4
tom
could you publish your page, to see what do u mean?
or paste the source code to figure out the problem?

I can say this in advance:

To find out how many frames are currently active in a window, use this
expression: parent.frames.length

This expression returns a number indicating how many frames the parent
window defines. This value does not, however, count further nested
frames, should a third generation of frame be defined in the
environment.

Therefore, if the window shows three frames (whose indexes are
frames[0], frames[1], and frames[2], respectively), the reference for
retrieving the title property of the document in the second frame is
parent.frames[1].document.title

This reference is a road map that starts at the parent window and
extends to the second frame's document and its title property. Other
than the number of frames defined in a parent window and each frame's
name (top.frames[i].name)

I hope this helps
Tom

Sep 1 '05 #5

Audrius wrote:
to do that I need to determine frame's name on rendering. As I said, in
Firefox I can get it using self.name. With IE it doesn't work for me.


That is odd as window.name is certainly a property IE implements for
windows and frames. I think you need to post a URL where the problem
occurs to allow us here to try to find out why it does not work and
hopefully find a way to get it to work.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 1 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jenkins | last post by:
I have a page with frames. The left frame is a list of urls. The main frame is loaded based on the url that was clicked in the left frame. Is there a way for the main frame to tell which url was...
4
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop"...
1
by: Funk | last post by:
Hi, I am currently creating a system that will support web based research. The idea is that the researcher is able to use Internet Explorer or Mozilla, or whichever browser to search for...
7
by: David Hayes | last post by:
I tried finding an answer on http://www.quirksmode.org/ without success. I am attempting a complicated Frames structure. I have made it work in IE, but not Netscape. I begin with three...
5
by: Frame | last post by:
I'm looking for tutorials or articles considering HTML Frames and how to handle them with Javascript. E.g. samples how Frames can exchange information, can a Frame instruct other Frame to update...
9
by: Christopher Benson-Manica | last post by:
I have the following situation: Page A opens a window named 'foo'. Page A then reloads itself. Is there a way for the reloaded Page A to determine whether there is an open window named 'foo',...
2
by: Travis.Box | last post by:
I have an MS Access userform with 16 Check Boxes. Each of the checkboxes has a different option value, which coincides with the Check Box name (eg. cb01.OptionValue = 1). At the bottom of the...
11
by: Rob | last post by:
I know, I know, don't use frames. Well, I'm stuck with these frames and I'm trying to add functionality without a complete redsign. You can look at this as a nostalgic journey. Anyway, I've got...
3
by: rajarya | last post by:
Hi, I m designing a HTML page(index.html),here i have 2 frames,by defult both frames have index1.html and index2.html as their source . in first frame(index.html) ,i have some redio buttons,and a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.