Safari doesn't call iframe onload when src is not valid site
问题 For the following iframe, Safari never calls the onload function and doesn't display anything in the iframe. All other browsers I've tested do call onload and display a default error web page. <html> <body> <iframe src="http://www.asdkjhjhkjhkjhjhjhfhkjhsdflkjahdsjfhasf.com" onload="alert('iframe loaded');"> </iframe> </body> </html> Why is this happening? If there is no solution to this problem, then I need to find a way to detect if an iframe fails to load. 回答1: I just the other day