我有一个 iframe,但是当你没有互联网连接时,它应该转到 error.html。
我的代码有什么问题?
<script>
function errorsrc() {
document.getElementById['frame'].src = "error.html";
}
</script>
<iframe id="frame" frameborder="0" src="http://www.google.com/" onerror="errorsrc()" ></iframe>
谢谢。