The syntax error in this page occurs before the onerror event handler is assigned, therefore the browser intercepts the error and the custom error message isn't displayed.