2

I need a little orientation regarding Google Chrome debugger. My application works only in Google Chrome because of well HTML5 support.

How can you pause on every single error/exception detected?

The source of this question it's the fact I'm doing a simple form submit with some Javascript validations. On clicking the submit button I can see an error appearing in my Dev Tools Errors Frame, but it switch immediately to my PHP called on submit still in development, switching the page and therefore I can't read the error.

I've tried setting breakpoints and I've clicked on that pause on exceptions button, but it's not helping me, I'm doing something wrong. I do not know completely how to use the debugger.

Léo Léopold Hertz 준영
  • 134,464
  • 179
  • 445
  • 697
Metafaniel
  • 29,318
  • 8
  • 40
  • 67
  • possible duplicate? http://stackoverflow.com/questions/2233339/javascript-is-there-a-way-to-get-chrome-to-break-on-all-errors – ossek Jun 06 '12 at 16:57
  • 1
    I read that question and others before posting, however my question also asks about pausing just before it changes page when submitting. I didn't find an answer to this, just some questions with Firefox extensions as answers, but I need a way to do it with Google Chrome. Thanks – Metafaniel Jun 06 '12 at 17:07

1 Answers1

2

Have you considered trying to put a break point in a handler function for the window.onSubmit event?

Maybe something like this for jquery: http://jsfiddle.net/7UZsk/27/

$(window).bind('submit',function(){
  alert("submitting");
});​

This is the actual DOM event reference: https://developer.mozilla.org/en/DOM/window.onsubmit

ossek
  • 1,648
  • 17
  • 25
  • I'm not so sure how to do it... you mean using JQuery? u.u – Metafaniel Jun 06 '12 at 17:53
  • I did it now. Your suggestion it's helpful indeed, but this is an action triggered at the moment of submit, quite handy yeah, thanks. But there must be a way to pause with Chrome's debugger, isn't it?? I'll accept this as an answer because it has solved my problem (sorry for the delay, I have many things to do at work). I wish someone can post a way to do it with Chrome's Debugger and I'll set that answer as the real answer. Meanwhile: THANKS A LOT =) – Metafaniel Jun 15 '12 at 16:15