I fixed this by simply adding var alert;
However, is this what I should be doing to get the pesky error message to go away? Here is the fix. Here is the fail on www.jshint.com.
I'm trying to learn from the error it throws..not necessarily make them go away.
(function () {
"use strict";
var alert; // added this in to fix
function initialize_page()
{
alert ("hi");
}
addEventListener('load', initialize_page);
})();
See Question&Answers more detail:os