+ 2
JS not linking
In my code, the javascript simply refuses to link. The code does not run on its own, and whenever I try to call anything with HTML it gives an uncaught reference error. I've tried putting the code in with the html document (tried both the head section and end of the body section, still same error). There is nothing in the code which should cause this problem, it just randomly started occuring.
6 ответов
+ 2
Well, we'll see about that. Could you please paste your code here?
A reference error happens when you try to use a variable that has not been defined. Maybe you forgot a var somewhere?
+ 2
In the teleport function it should be "Math.round", not "round", and in the freeze function, it should be "if(false)", not "if false". Also you have a function named "freeze" and a variable named "freeze", so you have a nameclash there. Rename either of them!
Pro tip: The developer console tells you exactly which line the error is on.
+ 1
Hi Jayce,
I agreed with Zen. Please, do whatever you did before on code playground, save your code and paste the link here so we can take a look and give you suggestions.
+ 1
I doubt that you typed that code yourself. What's the source?
+ 1
Ah thank you. I remember noticing the Math.round problem and fixing it, but I mustnt have saved it. Anyway, its now working.
+ 1
Also Zen, I actually did write this code myself, you can search it on google and you wont find any results.