Tuesday, 3 September 2013

Uncaught TypeError: Object # has no method 'alert'

Uncaught TypeError: Object # has no method 'alert'

Greetings to the community, i'm new in javascript and i want to figure out
why this code throws me this error, thank you!
"use strict";
var myFunction = function(){
document.alert("hola");
};
myFunction();
the console(chrome) says:
Uncaught TypeError: Object # has no method 'alert'
I've used jshint to correct any sintax errors, but it seems to have no
errors.

No comments:

Post a Comment