Forum Moderators: open

Message Too Old, No Replies

How shall I control the elements of iframe!

I want to scout links of iframe

         

mars

6:34 am on Feb 11, 2005 (gmt 0)

10+ Year Member



I want to scout click of iframe's anchor
but I do not know how to do it.

I have a function fun() ,I want every anchor click
of iframe will invoke this function
so I will know many times click of iframe's anchor

who can help me very thanks

mars

12:35 pm on Feb 11, 2005 (gmt 0)

10+ Year Member



how can i capture click events in ie?
i only want capture click in iframe area

rocknbil

7:06 pm on Feb 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When you say "scout click" do you mean find out what link is clicked?

You can do this ONLY if the page in the iFrame comes from your site. If it's an external site, you will get an access denied error, this is an internal security feature to prevent "sniffing" other frames.

There are many ways to capture a click. Attach the onClick event to the required object

href="whatever" onClick="fun(); return false"
body onClick="fun(); return false"