Firebug: Step through code on event, not refresh?

Hallo,

I have some half-working script I’m playing with that I half-understand (this is the real problem) which I’m having troube debugging because it always does work when I refresh.

So whenever I step through my functions with Firebug everything does what I expect it to do: but if then I re-invoke my onchange event, not every step is taken and it’s hard to see why because I can’t “see” what it’s doing after the page has loaded and the script run at least once.

This is for hide-and-show in a form and all the other versions I see online are even less understandable than what I’ve got so far. So I figure I’d better debug the one I have.

Anyone know how to re-watch a script onevent?

After a bunch of hard coffee and more staring at the code until my eyes glazed, I think I see what it’s doing and why it’s not doing what I want with the event. Will post the code I’ve got in another thread and ask.

I’m not really sure what you’re asking here. What do you mean by “refresh”? Refresh the page?
And what do you mean by re-invoke event?

I’d also be happy to take a look at the code if you posted that by the way.

I’m not really sure what you’re asking here. What do you mean by “refresh”? Refresh the page?

Yes.

And what do you mean by re-invoke event?
I have some stuff tied to an event: onchange. onchange is not doing everything it should, but refreshing the page with the change in values in place works.

Have you tried running it through the debugger built into Opera/Safari/Chrome/IE8 to see if it does the same thing there or whether the problem is specific to Firefox.

The only thing that’s Firefox specific is that Firefox allows your choice in a select drop-down to remain chosen even after refresh; other browsers reset the value to the first in source (I don’t have a “selected” attribute in there now). For those browsers the only way to test “refresh” with different values was to manually switch their order in the HTML. (IE also keeps your choice o refresh)

Everyone (Dragonfly always goes grey on me and I can only restart it by restarting Opera; IE8 I need to boot up another machine and I expect nothing I write to work in IE anyway so I save the bad news for later) seems to be showing steps working the same way, when the script first runs. It’s doing what I want. It’s checking every possible value.

But when I make a change (when I click my select and change the value), the script doesn’t run again, it just executes (so I can’t “see” what it’s doing). And it executes incorrectly. I was hoping there was a way to “see” what it was doing to find out why it was doing it differently when the event actually fires vs on first load.

If there isn’t then that’s fine: I’ll have to probably rewrite everything until it gets down to a level of simplicity I can understand and then see if I can get it working in any browser. Was just wondering if there was a way to watch events firing.

Scallio: if you want to see it, it’s here but since it seems I’ll have to completely rewrite it, there may not be anything there when you go to look (js is under js folder with a funclib and begrafenis.js).

Have you tried running it through the debugger built into Opera/Safari/Chrome/IE8 to see if it does the same thing there or whether the problem is specific to Firefox.