Search code examples
javascriptjqueryalerttypeerror

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


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] is not a function

My code is:

var shortenurl = msg.d;
alert(shortenurl);

I've checked the value and it has a string inside, not an object.


Solution

  • I had that error message due to an alert() blocked by my pop-up-blocker.