在 document.ready 上显示 Videobox

发布于 2024-12-25 14:54:16 字数 1390 浏览 0 评论 0原文

现在根据作者的 site 我应该能够通过像这样调用它来将 videobox 加载到准备好的文档上:

Videobox.open("your video page url","your caption","vidbox width height");

但我不断收到此错误:

Uncaught TypeError: Cannot call method 'setStyles' of undefined
   Videobox.positionvideobox.js:75
   Videobox.openvideobox.js:55
   (anonymous function)opcion2.html:13

这正在 Chrome 中进行测试,

这是我的代码,这很简单,因为我正在测试此功能:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title></title>
     <link rel="stylesheet" href="css/videobox.css" type="text/css" media="screen" />   

     <script type="text/javascript" src="js/mootools.js"></script>
     <script type="text/javascript" src="js/swfobject.js"></script>
     <script type="text/javascript" src="js/videobox.js"></script>
     <script language="javascript">
          Videobox.open('http://www.youtube.com/watch?v=VhtIydTmOVU', 'Test', 'vidbox 979 416');

     </script>

   </head>

   <body>

   </body>
 </html>

Now according to the author's site i should be able to load videobox on document ready by just calling it like this:

Videobox.open("your video page url","your caption","vidbox width height");

but I keep getting this error:

Uncaught TypeError: Cannot call method 'setStyles' of undefined
   Videobox.positionvideobox.js:75
   Videobox.openvideobox.js:55
   (anonymous function)opcion2.html:13

this is being tested in Chrome

here's my code it's just simple cause I'm testing this functionality:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     <title></title>
     <link rel="stylesheet" href="css/videobox.css" type="text/css" media="screen" />   

     <script type="text/javascript" src="js/mootools.js"></script>
     <script type="text/javascript" src="js/swfobject.js"></script>
     <script type="text/javascript" src="js/videobox.js"></script>
     <script language="javascript">
          Videobox.open('http://www.youtube.com/watch?v=VhtIydTmOVU', 'Test', 'vidbox 979 416');

     </script>

   </head>

   <body>

   </body>
 </html>

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

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

发布评论

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

评论(1

转身泪倾城 2025-01-01 14:54:16

您需要将其放入 document.ready 处理程序中:

$(function() {
    Videobox.open("your video page url","your caption","vidbox width height");
});

或者只需将进行此调用的原始脚本部分移动到 body


作者的网站只是说:

您还可以使用 JavaScript 开始视频。

Videobox.open("您的视频页面网址","您的标题","vidbox 宽度高度");

他从来没有说过在你的主人准备好之前你可以打电话。

You need to put that in a document.ready handler:

$(function() {
    Videobox.open("your video page url","your caption","vidbox width height");
});

Or just move your original script section that made this call to the end of your body


The author's site just says:

You can also start your videos with javascript.

Videobox.open("your video page url","your caption","vidbox widht height");

He never said you could call this before your dom was ready.

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