Skip to content

Instantly share code, notes, and snippets.

@sebm
Created April 25, 2018 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebm/ef45455a8f4a72c80542e4b5ca857c44 to your computer and use it in GitHub Desktop.
Save sebm/ef45455a8f4a72c80542e4b5ca857c44 to your computer and use it in GitHub Desktop.
<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