1. 程式人生 > >瀏覽器端如何使用VConsole.js除錯程式碼?

瀏覽器端如何使用VConsole.js除錯程式碼?

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>VConsole</title>
</head>
<body>
<script src='https://wechatfe.github.io/vconsole/lib/vconsole.min.js?v=3.0.0.0'></script>
<script type="text/javascript">
	window.vConsole = new window.VConsole();
	window.onerror
= function(errorMessage, scriptURI, lineNumber,columnNumber,errorObj) { console.log("錯誤資訊:" , errorMessage); console.log("出錯檔案:" , scriptURI); console.log("出錯行號:" , lineNumber); console.log("出錯列號:" , columnNumber); console.log("錯誤詳情:" , errorObj); } throw new Error("出錯了!"); </script> </body> </html>