Created
April 25, 2018 21:06
-
-
Save sebm/ef45455a8f4a72c80542e4b5ca857c44 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"><head> | |
</head> | |
<body translate="no"> | |
<button onclick="hey()">Hey</button> | |
<br> | |
<button onclick="windoh()">Windoh</button> | |
<br> | |
<button onclick="broke()"> Break</button> | |
<br> | |
<button onclick="ajax()">Doomed Ajax</button> | |
<script> | |
window.onerror = function(msg, file, line, col, error) { | |
console.log('we are in the global error handler') | |
console.log(arguments); | |
}; | |
function hey() { | |
console.log('hey'); | |
} | |
function windoh() { | |
console.log(window); | |
} | |
function broke() { | |
throw "Broke" | |
} | |
function ajax() { | |
try { | |
fetch('http://jsonplaceholder.typicode.com/posts/1').then(res => { | |
console.log(res); | |
}) | |
} catch (e) { | |
console.log('ajaxerror') | |
console.log(e) | |
} | |
} | |
</script> | |
</body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment