“oembed 为空” Firebug 控制台中出现错误(JQUERY OEMBED)

发布于 2024-10-20 17:34:15 字数 696 浏览 5 评论 0 原文

我遇到了 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/

Im having a problem with oembed outputting an error in firebug's console windows as such:

oembed is null
oembedContainer.html(oembed.code); 

which is when clicked will point to the jquery.oembed.js file.
my declaration of oembed is that it will replace all links with a class name of oembed, like so:

$(".oembed").oembed(null, {
                        embedMethod: "replace", 
                        maxWidth: 350,
                        maxHeight: 350,
                        vimeo: { autoplay: false, maxWidth: 350, maxHeight: 350 }                 
                        });

i think the error is pointing on the first parameter of the function oembed().
but i really dont know what is happening inside, do somebody know a workaround here??
This is the link where I got the code:
http://code.google.com/p/jquery-oembed/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦境 2024-10-27 17:34:15

我遇到了同样的问题,直到我注意到该代码片段有一个用于加载脚本的非绝对 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文