Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Frameset event capture for siblings

Status
Not open for further replies.

furan

Programmer
Aug 17, 2001
17
0
0
GB
Hi,
I have hundreds of pages with hundreds of acronyms on them. All of these and thier definitions are held in a database. Users can select an acronym (document.onclick()) and an ASP popup will appear giving them the def.... and that works fine, thing is I have a frameset with three frames in it and I also have hundreds of these pages.

Without doing a massive search and replace to put an included script file in each of these is there any way to tell the frameset to run this function whenever some text is selected, no matter what frame.

I have tried putting onclick events in the frameset or in the frames or both, but the event doesn't work for framesets.

Is there any way to specify at the top level that the onclick event is to work for any document that might be vierwed in the frameset or is it massive search and replace time for me?

Stuart
 
Code:
if(document.layers)
 frames[0].document.captureEvents(Event.MOUSECLICK);
frames[0].document.onclick=
 function(e) {
  alert("Clickety Click!");
 };
What the above code does is: Set the very first frame in the frameset to alert when it's clicked on.
 
Thanks UNIMENT, wasn't aware of the captureEvents bit. Now that I am it has sorted it out fine!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top