How to use IE to debug JavaScript scripts
Author:Eve Cole
Update Time:2009-06-08 18:33:21
JavaScript scripts are often used in B/S mode programs. Its functions are very powerful, but debugging is very troublesome because there are no suitable tools. In fact, IE supports script debugging of JavaScript. You only need to use IE and scripts to debug JavaScript. Make the appropriate settings.
1. Internet Options->Advanced->Disable Script Debugging and uncheck the checkbox behind it. This makes IE support script debugging, but this is not enough. We also need to make a simple decision in the code and add debugger where debugging is needed; indicating that debugging starts from here (sometimes it is necessary to reopen IE). When you open this page, a script debugging selection box will appear. Select a tool for debugging.
Here is a simple example
<html>
<head>
Script debugging
</head>
<body onload='test()'>
This is an example of calling the script debugger.
</body>
</html>
<script language='javascript'>
function test()
{
debugger;
var str = 'This is an example of calling the script debugger';
alert(str);
}
</script>
posted
http://www.cnblogs.com/interboy/archive/2006/08/06/469390.html