473,325 Members | 2,860 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,325 software developers and data experts.

catching events in a seperate frame ?.....

Hi,

I suspect that this may not be possible, but this is my little
problem.

I have a main page ('index.php') with an iframe ('mainframe') on the
left hand side. All the links on the index page load a new page of
mainly text content into the iframe.

All pretty straightforward, but I am using some javascript to launch
and hide a floating div on the index page (if I launch it in the
iframe, it will be restricted to the height and width of that frame).
The code to show / hide the div is located on the page index.php - say
the function is called 'showMe()', I would call top.showMe() to launch
the div.

The Div works fine, but when I try and catch an event via:

event.srcelement

it returns the error message 'object required', because it is being
passed from a link on a totally seperate page (the iframe)...

Is there any method for the main page (index.php) to catch the event
on 'mainframe' that triggers the div ?

The div's do show up and hide, and I can load source content into them
- only error messages keep flashing up on IE (but not on Netscape /
Firefox, etc)...

Is this possible ?

Thanks
Neil.
Jul 23 '05 #1
1 1389


Sylvian Stone wrote:

The Div works fine, but when I try and catch an event via:

event.srcelement

it returns the error message 'object required', because it is being
passed from a link on a totally seperate page (the iframe)...


In IE's event model each window/frame has an event object so for events
in the iframe you need the event object of the iframe e.g.
parent.showMe(window.event);
with
function showMe (evt) {
// access evt.srcElement here
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2

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

Similar topics

5
by: Roger Shrubber | last post by:
I have a page with images that the user can drag from one frame to another. I need them to see a "ghost image" of the image they are dragging, while the original stays put. I use the onmousemove...
3
by: Stampede | last post by:
Hi, I want to use the FileSystemWatcher in a Windows Service. I read an article, where the author created the FileSystemWatcher object in a seperate thread and when the event is fired, he started...
12
by: scsharma | last post by:
Hi, I am working on creating a webapplication and my design calls for creating main webform which will have menu bar on left hand side and a IFrame which will contain all the forms that are shown...
2
by: ghobley | last post by:
Hello, My application has 2 forms on display at one time. The form on the left contains a tree view which drives the contents of the form on the right. My problem is that I would like to capture...
3
by: daan | last post by:
Hello, I have a problem and I can't get the solution for it :( I have a com dll, which i imported as a reference. The com object is part of a class which is multithreaded and will create...
3
by: Robert Inder | last post by:
I am struggling to catch kestrokes within an Internet Explorer 6 window. My window happens to be displaying three frames, though I suspect a similar problem would arise with a single document. ...
5
by: lord.zoltar | last post by:
How can I prevent the big close button in the top of the window from closing the window? I want to have and "are you sure?" confirmation so the user must press "Yes" before the program ends. Right...
4
by: buggtb | last post by:
This may be a blindingly obvious question but I am working on a little project and I'm relatively new to PHP. What I am wanting to do it load a load of data from an array into a table generated by...
4
by: Jimmy | last post by:
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.