Debugging

U

Uriah Piddle

Hi Gang,

Does anyone know the best way to make IE run a debugger when it encounters
an error when running in VS 2005 debug mode? I'm new to web development and
just discovered I have an error that IE has been ignoring. I've isolated it
without the debugger but I would like to know how this works for future
reference.

When IE finds an error in a page off a web server, it offers to debug it in
VS. But when it finds an error in VS and I click OK (telling it to debug),
nothing happens.

Thanks.

Steve
 
K

Kevin Spencer

First, configure IE - use Tools|Internet Options, and go to the Advanced
tab. Uncheck the 2 "Disable Script Debugging" boxes, which are checked by
default. After this, any JavaScript error will prompt for you to open a
debugger (assuming you have one, which you do, since you have VS 2005). It
will also enable a couple of other helpful debugging features:

1. Using a JavaScript debugger statement to create a break point. Example:

script type="text/javascript"><--
function getTop(el, prev)
{
debugger; /* will break here */
var prevTop = prev.offsetTop + prev.offsetHeight;
el.style.top = prevTop + "px";
}
// -->
</script>

Also, under the IE View menu, there will be a "Script Debugger" menu item,
which will allow you to break on the next statement.

--
HTH,

Kevin Spencer
Microsoft MVP
Software Composer
http://unclechutney.blogspot.com

A watched clock never boils.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top