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.
Somewhere in your code you overrode alert
. Check for var alert = ...
or some other kind of declaration like that. Also check for window.alert
declarations.