How to make links inside iframe open in new window/tab?

3 replies
Okay so I'm trying to iframe an amazon offer on to MY website - then iframing that onto my Facebook fanpage.

So that's no problem, except when people on my fan page click on the offer, it opens up within the iframe, and is obviously too big for the fan page.

So I've been trying to find a code that makes all links within my iframe open in new window or tab, either will work.

Any idea?

I've tried target_blank/top with no luck.

Here is my code:

<div style='overflow: hidden; width: 409px; height: 223px; position: relative;' id='odiv'>

<iframe id='bframe' onload='base=history.length;framepopup(history.len gth);' name='bframe' src='http://myurl.com' style='border: 0pt none; left: -222px; top: 1px; position: absolute; width: 1280px; height: 680px;' scrolling='no'></iframe></div>
#iframe #inside #links #make #open #window or tab
  • Profile picture of the author theofficialSJ
    Am well versed with the DNA of iFrame tabs
    {{ DiscussionBoard.errors[3606806].message }}
    • Profile picture of the author RyanAndrews
      You won't be able to change the link target because it's on the amazon page.
      Can you not just put the amazon offer directly into your fanpage?
      {{ DiscussionBoard.errors[3607038].message }}
      • Profile picture of the author oldwarrioruser1
        Originally Posted by RyanAndrews View Post

        You won't be able to change the link target because it's on the amazon page.
        Yes I was afraid of that. I was just hoping there was some php magic or something that can make all links within an iframe open in new windows.

        Originally Posted by RyanAndrews View Post

        Can you not just put the amazon offer directly into your fanpage?
        Well I was trying out a certain method, guess I'm going to have to reconstruct here
        {{ DiscussionBoard.errors[3609031].message }}

Trending Topics