Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

iframes and targets

  • 03-07-2012 12:15AM
    #1
    Registered Users, Registered Users 2 Posts: 22,575 ✭✭✭✭


    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, Registered Users 2 Posts: 1,110 ✭✭✭Skrynesaver


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


  • Registered Users, Registered Users 2 Posts: 22,575 ✭✭✭✭Steve


    Doh..:o

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

    Cheers for that.


Advertisement