Javascript not running/executing?


#1


I'm new so please be patient, I'm trying to learn Javascript on my computer with no Internet connection, I opened scratchpad in Mozilla.
But whenever I type the script I get :
Exception: SyntaxError: expected expression, got etc.....
What am I I wrong?


Replace this line with your code.


#2

in var s = (Math.floor(Math.random()*2)%2)) you have an extra closing paranthesis.


#3


#4

html tags aren't part of js (look at what the error message is saying)

You could load a html file with js in it in a script tag, but the interface you've got up there is probably more convenient so long as you're only running javascript without any interest in a web page


#5


I deleted the script tag but stil not having any luck, can you give an example as to how this is supposed to work..


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.