Uncaught ReferenceError: alter is not defined

As i open console as shown in the javascript video its shows this error,i dont know what to do?

Which javascript video are you referring to? If in case you mean the alert() function then you must have a typo in your code. Replace the world ‘alter’ to ‘alert’.

You may also just search up your errors on stack overflow or other forums if in case you are stuck somewhere.

Hi @chandruchethan36368,

Please share the screenshot of your code and screenshot of the error so that we can help you out with this query.

Do let me know in case you need further assistance.

If you are using any script file and getting "Uncaught ReferenceError: x is not defined " which means ‘x’ is either a variable or a method which you are trying to use before declaring it using var keyword. This means that there is a non-existent variable referenced somewhere. This variable needs to be declared, or you need to make sure it is available in your current script or scope otherwise , it will endup throwing this ‘x’ is not defined error . This usually indicates that your library is not loaded and JavaScript does not recognize the ‘x’.

To solve this error: Load your library at the beginning of all your scripts.

There can be multiple other reasons for this issue:

  • Conflict with Other Libraries
  • Path to your library included is not correct
  • Llibrary file is corrupted
  • Working offline (when you use CDN)