在 document.ready 上显示 Videobox
现在根据作者的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将其放入 document.ready 处理程序中:
或者只需将进行此调用的原始脚本部分移动到
body
作者的网站只是说:
他从来没有说过在你的主人准备好之前你可以打电话。
You need to put that in a document.ready handler:
Or just move your original script section that made this call to the end of your
body
The author's site just says:
He never said you could call this before your dom was ready.