473,776 Members | 1,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

to get the frame index and name in IE & Mozilla

Hello people,

I'm working with HTML and Javascript. I have some problems in handling
frames. I have the following questions:

1. How do I retrieve the name of a FRAME in IE & Mozilla using a
onclick event handler

I have done this for IE and it is as follows:
this.frames.nam e
The above thing will be called inside the event handler.
I need to know the same for Mozilla and I couldn't use the above
as it is not working there.

2. How do I retrieve the FRAME index in IE & Mozilla using a onclick
event handler.

The index here I mean is:
frames[index]
I exactly want the integer of the index.

Thanks in advance,
MAK

May 23 '07 #1
2 6151
ar*********@gma il.com said the following on 5/23/2007 8:47 AM:
Hello people,

I'm working with HTML and Javascript. I have some problems in handling
frames. I have the following questions:

1. How do I retrieve the name of a FRAME in IE & Mozilla using a
onclick event handler

I have done this for IE and it is as follows:
this.frames.nam e
The above thing will be called inside the event handler.
I need to know the same for Mozilla and I couldn't use the above
as it is not working there.
parent.frames[this.frame].name

Maybe, untested though.
2. How do I retrieve the FRAME index in IE & Mozilla using a onclick
event handler.

The index here I mean is:
frames[index]
I exactly want the integer of the index.
Get the name of the frame, loop through the parent.frames collection
until you find the name, then you have the index.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
May 23 '07 #2
Sorry Mr. Randy

The above code you suggested is not working. It is returning error in
the error console of Mozilla. The error is as follows:

parent.frames[this.frame] has no properties

What can I do now? Do you have any other suggestions...
thanks and regards,
MAK

May 24 '07 #3

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

Similar topics

2
4509
by: Java_Forum | last post by:
hi, here is my main html file INDEX.JSP ------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META name="GENERATOR" content="IBM WebSphere Studio"> <TITLE>main.html</TITLE>
7
2332
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 frames, where the two lower ones are within a Frameset within the master Frameset: 1111111111111111111
3
1563
by: mlybarger | last post by:
i have a popup window that's built from javascript with something like: source += "<html>"; source += " <head>"; source += " </head>"; source += " <frameset rows='100,*'>"; source += " <frame id='controls' name='controls' />"; source += " <frame id='data' name='data' />"; source += " </frameset>"; source += "</html>";
3
10203
by: Vongza | last post by:
<html> <head> <title>Cross Frame Reference</title> <script language="javascript"> function showThisTitle() { alert(document.title); } function showAnotherTitle() { try { alert(anotherWorld.document.title);
17
4182
by: Bruno | last post by:
I have a feature that is hosted on a different domain from the primary one in a frame, and need to retain values in a cookie. example: A web page at one.com contains a frame which has a page hosted at two.com If I view the frameset from one.com in Firefox, all works well with the content from two.com. But if trying to view this using IE (with standard security settings), the cookie set by two.com is not accessible.
11
16961
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 the following frame structure at the top level: FRAMESET CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"> <html><head><title>Server List</title></head> <frameset frameborder="1" border="1" framespacing="1" rows="10%,89%">
2
5939
by: PieOPah | last post by:
I have a webpage that uses frames (yes I know, frames - previously been flamed about that, but I do not know anything else to use since I am clueless!!! Been asked to cobble together a site since there is a misconception that I know what I am doing!!!) Anyway, one of the things I have been asked to do is create a button that will allow the user to print the contents of the main window (main frame) without the navigation bar (header...
3
2856
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 submmit button. so when I select one ption and click the submit button in the left side frame(or frame 1 or in index1.html) my right side frame should be reloded with a new html page as per the javascript method in main html page. but insted I...
7
3002
by: Leoa | last post by:
Hi All, I'm having a hard time figuring out the DOM syntax to get one frame that has thumnails of images to display at full size in another frame (onmouseover). I looked at a couple tutorials and have come up with the broken script below. Please Help.- ------------------------------------------
0
9627
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9462
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10287
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10060
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9922
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8951
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7469
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4030
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3621
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.