SWFObject 无法通过 Google Libraries API 运行?
当我在本地加载 swfobject.js 时,以下嵌入代码工作正常。但是,当我尝试从 Google Library API 加载 swfobject.js 时,Flash 影片无法加载。我知道我使用的是有效密钥,并且 swfobject.js 文件已明确加载,但我收到“未捕获的引用错误:SWFObject 未定义” (匿名函数)”
有什么想法吗?
<body>
<!-- DOESN'T WORK -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=(VALID KEY)"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<!-- WORKS -->
<!--script type="text/javascript" src="swfobject.js"></script-->
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("mySwf.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");
</script>
</body>
The following embed code works fine when I load swfobject.js locally. However, when I try to load the swfobject.js from Google Library APIs, the Flash movie fails to load. I know I'm using a valid key, and the swfobject.js file is definetely being loaded, but I get an "Uncaught ReferenceError: SWFObject is not defined
(anonymous function)"
Any ideas?
<body>
<!-- DOESN'T WORK -->
<script type="text/javascript" src="http://www.google.com/jsapi?key=(VALID KEY)"></script>
<script src="http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js"></script>
<!-- WORKS -->
<!--script type="text/javascript" src="swfobject.js"></script-->
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("mySwf.swf", "mymovie", "400", "200", "8", "#336699");
so.write("flashcontent");
</script>
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
v2.2 不使用旧的 1.x api。
尝试这样的事情。
v2.2 does not use the old 1.x api.
Try something like this.