Error on using alert in Javascript (Property 'alert' of object is not a function)

后端 未结 6 661
北恋
北恋 2021-01-11 12:59

I am just trying to use alert and put a string variable inside the alert and get an error:

Uncaught TypeError: Property \'alert\' of object [Object Window] i         


        
6条回答
  •  滥情空心
    2021-01-11 13:17

    Mozilla says,

    The alert function is not actually a part of JavaScript itself.
    

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Introduction_to_Object-Oriented_JavaScript

    You can not see a function called alert here : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects

提交回复
热议问题