1

I am learning HTML5, and i use Three.js 3D engine. following this example, the tutorial assume i included three.js file into my HTML file. However, i found two files with that name, so i included both but nothing appear to work.

In my html file:

<script src="three.js/build/three.js"></script>
<script src="three.js/src/Three.js"></script>

Three.js package is in the same directory as my html file and it's in a folder called three.js.

Am i including the wrong file(s)?

EDIT

When i debug in Mozilla FireFox, i got this message:

[13:41:04.275] ReferenceError: $ is not defined @ 

The line causing the error is this:

// get the DOM element to attach to
// - assume we've got jQuery to hand
var $container = $('#container');

Thanx for help.

2
  • Have you ever tried Firebug for Firefox (I think something similar, Firebug lite, is available for chrome). Firebug lets you step through javascript code and gives you a lot more useful information than just the browser. Also, if you are using firefox you can use the developer console to get some error messages, which will help you fix your issue. Commented Sep 7, 2012 at 0:41
  • @WayneUroda Modern versions of browsers Chrome, Safari, Opera and IE has built in tools. Firebug lite is no longer necessary. Commented Sep 7, 2012 at 1:21

2 Answers 2

1

If the js file is in the same directory you should just do

<script src="three.js"></script>

The path to the file inside the src attribute is relative to the current file.

Sign up to request clarification or add additional context in comments.

2 Comments

"Three.js package is in the same directory as my html file and it's in a folder called three.js."
I edited my post, i think it's related to a jQuery library which is missing, but i can not find any reference for jQuery in the Three.je folder.
0

Since r50 it should be:

<script src="three.js/build/three.min.js"></script>

1 Comment

This seems to be a jQuery issue now. Nothing to do with three.js.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.