Skip to content

Instantly share code, notes, and snippets.

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 ara-ta3/c979749ed0c220d7f69abd801834bf34 to your computer and use it in GitHub Desktop.
Save ara-ta3/c979749ed0c220d7f69abd801834bf34 to your computer and use it in GitHub Desktop.

ScriptError line 0に悩まされたやつ.md

(function(w) {
w.addEventListener('error', (e) => {
console.log("onerror~");
console.log(e);
});
const err = () => {
setTimeout(function() {
throw new Error("hogeeeee");
}, 0);
};
err();
})(window);
<?php header("Access-Control-Allow-Origin", "*"); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" defer src="app.js" crossorigin></script>
</head>
<body>
It works !! php !!
</body>
</html>
port=8081
server:
php -S localhost:$(port) -t .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment