“oembed 为空” Firebug 控制台中出现错误(JQUERY OEMBED)
我遇到了 oembed 在 firebug 的控制台窗口中输出错误的问题:
oembed is null
oembedContainer.html(oembed.code);
单击该窗口时将指向 jquery.oembed.js 文件。 我对 oembed 的声明是,它将用类名 oembed 替换所有链接,如下所示:
$(".oembed").oembed(null, {
embedMethod: "replace",
maxWidth: 350,
maxHeight: 350,
vimeo: { autoplay: false, maxWidth: 350, maxHeight: 350 }
});
我认为错误指向函数 oembed() 的第一个参数。 但我真的不知道里面发生了什么,有人知道这里的解决方法吗? 这是我获取代码的链接: http://code.google.com/p/jquery-oembed/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了同样的问题,直到我注意到该代码片段有一个用于加载脚本的非绝对 url。因此它根本没有加载。更改此内容:
对于脚本的实际 url,例如,如果您在本地进行测试,并且 html 测试页和脚本都位于同一文件夹中:
这样就可以了。
I had the same problem until I noticed the snippet had a non absolute url for loading the script. Therefore it never loaded at all. Change this:
<script type="text/javascript" src="../../jquery.oembed.js"></script>
For the actual url of your script, for example, if you're testing it local and both the html test page and the script are in the same folder:
<script type="text/javascript" src="jquery.oembed.min.js"></script>
That will do the trick.