Programming Languages

JavaScript, like most programming languages, has very strict rules about what constitutes valid code that can be interpreted by the JavaScript interpreter. The smallest typing error can make the interpreter give up and have the browser report an error. In other cases nothing will work or you will get unexpected results. Here is a short and incomplete list of what can go wrong and what to do about it.
  • JavaScript is case sensitive. Document.write() will not work. Neither will document.Write(). Almost every object, property, and method name like document and write() begin with a lower case letter. In cases like document.bgColor the second word in an object, property, or method name is almost always capitalized. I.e. the C in bgColor but nothing else.
  • Use the American spelling of Color. There is no color property.
  • Don't forget the closing bracket. Brackets in meth.
Flag Counter