faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 11 people (36%) answered Yes
Recently 3 of 10 people (30%) answered Yes

Entry

I want to capture mouse click event on a control inside a frameset

Apr 8th, 2008 18:20
ha mo, Dave Clark, Vishwa Rao,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Vishwa,
     Presuming, in the first place, that the target document in the 
target frame, within the indicated frameset, is within the same domain 
as the document in which your JavaScript is executing (because of 
uncircumventable cross-domain Internet security restrictions), first 
see this FAQTS entry:
http://www.faqts.com/knowledge_base/view.phtml/aid/39715/fid/53
     Then, just know that you can reference any other document in any 
other frame within any other frameset just by understanding the 
heiarchy of what is currently loaded in the browser window:
  o  "top.frames.length" will tell you the total number of frames in 
the topmost frameset document.  Even if that document contains embeded 
FRAMESET tags, the frames within those embeded FRAMESET tags are still 
counted (and accounted for) within the "top.frames" collection.
  o  "top.frames[x].document" will reference each document within 
those frames -- where "x" is a loop counter variable.
  o  "top.frames[x].frames" and "top.frames[x].frames.length > 0" will 
tell you if a particular frame contains another frameset document 
(i.e., loaded as a separate frameset document).
     Lastly,  I've never experimented with event bubbling beyond the 
document level.  You'll have to research whether this happens, or not, 
for yourself.
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com