1. in IE go to Tools > Options > Advanced and uncheck disable script debug (internet explorer) and uncheck disable script debug (other)
2. Inside Javascript insert the command debugger;
and every time IE encounters debugger VS will be executed, and you can debug javascript.