Wednesday, June 13, 2012

Sometimes the tool you need is right in front of you


Email To: Coworkers
Subject: Remember that bug I had last week, the one where I was hoping for an epiphany?
No epiphany whatsoever.

Here's the symptom: When the main Foxhound service starts for the first time, it launches the Activation service and the Activation page is displayed.

When the user enters a registration code and clicks on a button on the Activation page, the HTML and JavaScript code was supposed to re-launch the Activation service to check the input, but instead it always launched the main Foxhound service again...

...and that service still thinks it's the "first time" and it launches the Activation service with an empty registration code... an endless loop from the user point of view.

Endless fiddling produced no improvement.

So, today, I used Google Chrome's debugging facility - the tool that's "right in front of you"...
  • right mouse on the page - Inspect element,

  • and when the bottom half of the display turns into a debugging frame,

  • switch to the Console tab to see error messages.
When I clicked on the misbehaving button, a red error message would flash momentarily on the Console display. By going click - click - click to get the message to flash - flash - flash, I could see it was saying the function submitF was undefined.

Aha! An HTML INPUT tag said to execute a JavaScript function called submitF() but the actual function was called submitF1().

One steenking character... bet that's never happened to YOU! :


Dilbert.com


It turns out you can tell the Chrome Console to keep the error message on-screen, by right mouse - Preserve log upon navigation:





1 comment:

jpo said...

Chrome's developer tools rock.