o3d javascript未捕获引用错误

o3d javascript未捕获引用错误,javascript,o3d,referenceerror,Javascript,O3d,Referenceerror,我是javascript新手,对创建一个小o3d脚本很感兴趣: <!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="Conten

我是javascript新手,对创建一个小o3d脚本很感兴趣:

<!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>Test Game Website</title>
</head>

<body>

<script type="text/javascript" src="o3djs/base.js"></script>
<script type = "text/javascript" id="myscript">

o3djs.require('o3djs.camera');

window.onload = init;

function init(){
 document.write("jkjewfjnwle");
}

</script>

<div align="background">
 <div id="game_container" style="margin: 0px auto; clear: both; background-image: url('./tmp.png'); width: 800px; height:600px; padding: 0px; background-repeat: no-repeat; padding-top: 1px;"></div>
</div>

</body>
</html>
显然,因为它找不到o3djs/base.js

我已经从谷歌安装了o3d插件,他们说应该就是这样 我试过firefox,ie和chrome


谢谢,HTML指向的文件(CSS、JS、链接)是相对于文档路径搜索的


例如,如果您的文档的URL是
http://localhost/foo/testpage.html
,在这种情况下,必须将提到的
base.js
放入
http://localhost/foo/o3djs/
,等等。因此,如果您的本地主机位于C:\Server(假设您使用一些类似Windows的环境),文件名必须为C:\Server\foo\o3djs\base.js。

还要确保包含API所需的所有其他文件,其中大多数文件都可以在此处找到:

您将javascript源(“base.js”)放在哪里?你的页面是从哪里来的?我现在只是想在本地运行页面。就是这样,o3d网站告诉我要做的就是安装插件,我很乐意去。可惜谷歌没有提到我必须下载一个zip,甚至没有提到在哪里下载。我必须从样品中得到它。谢谢
<script type="text/javascript" src="o3djs/base.js"></script>
 o3djs.require('o3djs.camera');