在Google Gadget(xml)中,我有以下代码.它适用于Chrome和IE,但不适用于FF.控制台错误报告"错误:在NPObject上调用方法"进行javascript调用..嵌入核心模块..
<script type="text/javascript">
var tag = document.createElement('script');
tag.src = "//www.youtube.com/iframe_api";
//tag.src = "https://www.youtube.com/iframe_api"; // FireFox compatibility when "HTTPS Everywhere" plugin is installed
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var done = false;
var player;
function onYouTubeIframeAPIReady() {
var w=window.outerWidth;
if (w < 561) {
var pwidth = "560";
var pheight = "315";
}
if (w > 559 && w < 640) {
var pwidth = "560";
var pheight = "315";
}
if (w > 639 && w < 853) …Run Code Online (Sandbox Code Playgroud) youtube-api ×1