开发者

Fancybox YouTube Video not working on Localhost

开发者 https://www.devze.com 2023-03-15 14:44 出处:网络
I am having an issue getting Fancybox\'s YouTube video implementation working on my localhost.Wh开发者_StackOverflowen I load the page I get this error:

I am having an issue getting Fancybox's YouTube video implementation working on my localhost. Wh开发者_StackOverflowen I load the page I get this error:

Unsafe JavaScript attempt to access frame with URL http://sites:8888/clients/project_name/v1/products/index from frame with URL http://www.youtube.com/embed/RtXSVGsQ8N0. Domains, protocols and ports must match.

I obviously want to make sure the implementation is working correctly before I push it to the live server.

Thanks in advance.


Seems you are either trying to do a cross domain ajax call. Whats your browser?


To clarify on ToyDaVirus, make sure you specify type as iframe in parameters.

i.e. 'type' : 'iframe'


$('#selector').click(function() {

        $.fancybox({

        'padding'           : 10,
        'autoScale'         : false,
        'transitionIn'      : 'elastic',
        'centerOnScroll'    : true,
        'overlayColor'      : '#000',
        'transitionOut'     : 'none',
        'title'             : this.title,
        'width'             : 680,
        'height'            : 495,
        'href'              : this.href.replace(new RegExp("watch\\?v=", "i"), 'v/'),
        'type'              : 'iframe',

        'swf'               : {
            'wmode'             : 'transparent',
            'allowfullscreen'   : 'true'
        }

        });

        return false;
});
0

精彩评论

暂无评论...
验证码 换一张
取 消