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
I'm adding this one as an addition to this. In my case, when I had a similar problem, it turned out to not be my own code that was causing the problem but a poorly written extension that had been added to a client's browser. Once it was disabled, the script error went away.
If you haven't overridden the method name in your own code anywhere, you may want to try disabling extensions to see if any of those is inadvertently interfering with your script.