You probably won't be able to get events to propagate up out of the
iframe, but you can have event handlers in the iframe that call out to
functions in the main page. Something like (untested):

main.html:
<script ...>
function handleEventFromIFrame(e) {
  alert('Got an event from the iframe: ' + e);
}
</script>

sample.html:
<script ...>
$(document).ready(function() {
  $(...).bind('click', function(e) {
      top.handleEventFromIFrame(e);
   });
});
</script>

--Erik


On 8/7/07, julio <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I have locally two html files:
>
> main.html:
>
> <html>
> <head>
> </head>
> <body>
> <script type="text/javascript">
> // here??
> </script>
> <iframe id='myframe' src="sample.html"></iframe>
> </body>
> </html>
>
> sample.html
>
> <html>
> <head>
> </head>
> <body>
> <h1>title</h1>
> <h3>title 2</h3>
> </body>
> </html>
>
> sample.html is loaded in main.html by iframe.
>
> how is it possible catch (for example) a mouse-click on an element of
> sample.html in main.html without modify sample.html above with
> jquery????
>
> I have tried many times and ways without success. Can you help me?
>
> Thanks,
> Julio
>
>

Reply via email to