Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

iframes and targets

Options
  • 03-07-2012 1:15am
    #1
    Moderators, Category Moderators, Entertainment Moderators, Sports Moderators Posts: 22,584 CMod ✭✭✭✭


    Can anyone tell me what I'm doing wrong here:

    [HTML]<!DOCTYPE html>
    <html>
    <head>
    <title>Videos test</title>
    <style type="text/css">
    #vidcontainer{
    width:600px;
    height:450px;
    float:left;
    margin-left:15px;
    border-style:groove
    }
    </style>
    </head>
    <body>
    <a href="http://www.youtube-nocookie.com/embed/-slyeyhwE68?rel=0&wmode=transparent&autoplay=1&quot; target="vidcontainer">Father Ted</a>
    <br/>
    <a href="http://www.youtube-nocookie.com/embed/7xnNhzgcWTk?rel=0&wmode=transparent&autoplay=1&quot; target="vidcontainer">Fawlty Towers</a>
    <hr/>
    <iframe id="vidcontainer"></iframe>
    </body>
    </html>
    [/HTML]

    I've reduced the code to the above in an effort to debug - basically I want an iframe that displays a youtube vid based on the link that is clicked outside of the iframe - hence the "target=" bit.

    It works fine in chrome not in FF / IE and I'm not sure why.

    Chrome throws this exception but still works:
    Unsafe JavaScript attempt to access frame with URL file:*path*/test.html from frame with URL http://www.youtube-nocookie.com/embed/-slyeyhwE68?rel=0&wmode=transparent&autoplay=1. Domains, protocols and ports must match.

    FF & IE both open the link as if I'd specified target="_blank"

    Do I have to create individual html pages on the same domain with the vids embedded in them and then point the iframe to them for this approach to work?


Comments

  • Registered Users Posts: 1,109 ✭✭✭Skrynesaver


      <iframe name="vidcontainer"></iframe>
    


  • Moderators, Category Moderators, Entertainment Moderators, Sports Moderators Posts: 22,584 CMod ✭✭✭✭Steve


    Doh..:o

    Bloody Chrome and it's ability to self-fix obvious code errors without telling you...

    Cheers for that.


Advertisement