# How to do this with Rails + jQuery (or Prototype)

**URL:** <https://www.ruby-forum.com/t/how-to-do-this-with-rails-jquery-or-prototype/115663>\
**Category:** Rails\
**Created:** [September 27, 2007, 11:21am UTC](https://www.ruby-forum.com/t/how-to-do-this-with-rails-jquery-or-prototype/115663 "2007-09-27T11:21:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [September 27, 2007, 11:21am UTC](https://www.ruby-forum.com/t/how-to-do-this-with-rails-jquery-or-prototype/115663/1 "2007-09-27T11:21:08Z")

</div>

Hey all,

I’d like to do the following:

.) Initially I have a page with a form containing a single input field.  
.) I enter an URL into the input field, the page is loaded and placed  
inside a div (or an iframe, or whatever) inside the initial page.  
.) I want to capture user interaction (let’s say only mouse clicks for  
now) inside the div - e.g. if an user clicks an element, it’s XPath will  
be written below the initial search box.

I hope it’s clear what I am trying to do. I would need just a high level  
solution (if it is possible at all - I think it should be). I am using  
jQuery whenever I can - do you think it’s worth switch to Prototype for  
this stuff?

Cheers,  
Peter  
\_\_  
[http://www.rubyrailways.com](http://www.rubyrailways.com)  
[http://scrubyt.org](http://scrubyt.org)

---

<div class="post-metadata">

**Author:** ![splattael](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@splattael](https://www.ruby-forum.com/u/splattael)\
**Post date:** [September 27, 2007, 1:47pm UTC](https://www.ruby-forum.com/t/how-to-do-this-with-rails-jquery-or-prototype/115663/2 "2007-09-27T13:47:21Z")

</div>

If i get you correctly, you want to capture clicks on the pag that is  
loaded inside the iframe (you have to use an iframe for this)

I really doubt this is possible as it would open up doors to XSS-  
Attacks. But i i’m not sure.  
If it is possible, i don’t know how 😉
