# Clicking on links within facebook iframes (facebook apps)

**URL:** <https://www.ruby-forum.com/t/clicking-on-links-within-facebook-iframes-facebook-apps/139340>\
**Category:** Rails\
**Created:** [June 3, 2008, 2:41am UTC](https://www.ruby-forum.com/t/clicking-on-links-within-facebook-iframes-facebook-apps/139340 "2008-06-03T02:41:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubenz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rubenz](https://www.ruby-forum.com/u/rubenz)\
**Post date:** [June 3, 2008, 2:41am UTC](https://www.ruby-forum.com/t/clicking-on-links-within-facebook-iframes-facebook-apps/139340/1 "2008-06-03T02:41:05Z")

</div>

Hello,

I have a problem with clicking on the links in facebook apps due to  
iframes. I am trying to write a little script to run through the funwall  
app.

I used IE Dev toolbar to get the name of the id of the iframe (those  
iframes how no name attribute). So I run this command:

$ie.frame(:id, “app2378983609\_fb\_frame”).link(:text, ‘View this  
post’).click

And I get this:

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/frame.rb:52:in  
`method\_missing’: document (WIN32OLERuntimeError)  
OLE error code:80070005 in   
Access is denied.

```
HRESULT error code:0x80020009
  Exception occurred. from

```

c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/frame.rb:52:in  
`document' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/locator.rb:31:in`each\_element’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/locator.rb:40:in  
`locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/container.rb:830:in`locate\_tagged\_element’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/link.rb:24:in  
`locate' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:47:in`assert\_exists’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:281:in  
`enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:53:in`assert\_enabled’  
from  
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:226:in  
`click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.4/./watir/element.rb:212:in`click’  
from C:/watir/FunwallPost.rb:28

Does anyone know how to get around this?

Any help would be appreciated.  
Thanks.

---

<div class="post-metadata">

**Author:** ![rubenz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/59ef9b/32.png) [@rubenz](https://www.ruby-forum.com/u/rubenz)\
**Post date:** [June 3, 2008, 4:39am UTC](https://www.ruby-forum.com/t/clicking-on-links-within-facebook-iframes-facebook-apps/139340/2 "2008-06-03T04:39:36Z")

</div>

Hi,

Not sure if I understand your question.

If you have a link inside an iframe in your facebook app and you want  
it to make your app go to another page, just add

:target=\>“\_top”

to your link\_to call. You don’t need to name the iframe specifically.

Vidal.

On Jun 2, 5:41 pm, Ruben Z. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
