My problem is that I thought
src="undefined"
will trigger the error handler, but it never triggers, so I replace undeined with empty string, the error handler img then shows. Maybe the problem is not 'why error not working', but 'when will it trigger the error' ?