WebDevelopersNotes logo

home-icon Home / JavaScript / JavaScript Errors – Understanding and Correcting

JavaScript Errors – Understanding and Correcting

JavaScript Errors – Understanding and Correcting

A short note about errors before we proceed to the next session.

When you are learning a new programming language it takes time to understand its syntax. Your code might have a few bugs; it’s okay as long as you know how to correct them.

JavaScript beginners mainly make three kinds of errors

  • They might try to call a variable that is not yet defined.
    Solution: Remember to always initialize all variables you expect to use in the script.

    JavaScript Error in Internet Explorer

  • Forgetting the starting or ending quote or parenthesis as in a method or function.
    Solution: Place the opening and ending parenthesis or quotes together, then write the code/text between them.

    JavaScript Error in Internet Explorer

    JavaScript Error in Internet Explorer

  • Using a property or method that does not belong to an object, for example, using document.alert() instead of window.alert().
    Solution: You don’t have to learn each and every object’s properties and methods at the very start… you’ll get the hang of it all gradually.

    JavaSCript Error in Internet Explorer

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Sponsored Links

Tips

How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]

Fact

Amazon hadn't made a profit in the first six years of operation. Launched in 1994, the company showed profit in the books only in the last quarter of 2001. [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy