Here is a little test function I’ve been playing around with to try and avoid jslint’s ‘implied global’ error when using alert().
Enclosing the alert in a function then calling that function I thought would have made the alert specific to that function not global. Obviously I’m missing something…
Is it possible at all to write an alert() anywhere or in any scope without attracting this error?
(also tried window.alert() and this gives window as the implied global)
[CODE]
function test()
{
var mailingAdd = {
“address” : “34 Short Street”,
“suburb” : “Pleasantville”
};
alert(“The address is ” + mailingAdd.address + “, ” + mailingAdd.suburb + “.”);
}
test();