views:

165

answers:

2

About 5 times over the past 6 months, in complex javascripts, I'll get an error in firefox only (IE6, 7, 8, Chrome, Safari, Opera are all fine) whereby nothing in my javascript happens.

There will be no messages in the error console, and according to Firebug, all my scripts are totally blank. Force reloading and clearing the cache does not help. I usually just revert to a previous revision when this happens and start my last edits again.

  • It happens most in Firefox 3. It does happen a little in FF2, and FF3.5b but not to the same extent.
  • The only common link I found is all the changes had involved modifying code that ran in jQuery's $(document).ready() method.
  • On two occasions this caused the browser to lock up and crash.
  • None of the other browsers even report a warning in the error log.

Has anyone else noticed this happening? Is there a specific cause? Or is there some firefox bug responsible?

EDIT: The latest firefox killing change

From

var coord_array = jsc.core.coordsFromId($(e.target).attr("id"));
$("#co-ords").html("X:" + coord_array[0] + " Y:" + coord_array[1]);
jsc.data.last_mouse_over = { x: coord_array[0], y: coord_array[1]};

To

var coord_array = jsc.core.coordsFromId($(e.target).attr("id"));
$("#co-ords").html("X:" + coord_array[0] + " Y:" + coord_array[1]);
var cellX = parseInt(coord_array[0], 10);
var cellY = parseInt(coord_array[1], 10);
jsc.data.last_mouse_over = { x: cellX, y: cellY};

As you can see, there's nothing too major changing here. This code works fine on its own, without the rest of my javascript (other than the functions/data it uses), and it works fine in every other browser I have tested aswell.

+3  A: 

Do you have your Console enabled in firebug? I ran into this sort of problem last night where nothing happened until I enabled the Console. Very strange indeed.

This was when I was using one of the Logging functions in my JQuery code.

Edit:

Also, I have been experiencing a lot of firefox crashes lately. It seems the latest build is prone to crashing for me. This is on any site, not just my own.

Joe Philllips
Yes, I have the firebug console permanently enabled.
Macha
Have you tried running it without the firebug console enabled? It's possible that something is causing firebug to lock up.
dburke
I'll second dburke's suggestion. Firebug can occasionally become confused by $(document).ready() scripts - not sure, but it seems like it doesn't always manage to finish injecting its own scripts before they fire.
Shog9
dburke is on to something, but it could be any other addon that is causing the issue too.
Chad Scira
Thanks. Disabling console fixed both Firebug's display and the script.
Macha
I need to disable the Firebug Console to get one of my pages working as well. I haven't been able to pinpoint why.
neu242
+1  A: 

this is not enough info to determine an exact cause jQuerys $(document).ready() works just fine. If your not getting an actual verbose error its probably an error within one of your objects. I would go through my logic with a fine tooth comb, and look for anything that may cause an error X% of the time.

also you should be testing on a clean install of firefox (as well as any other browser) firefox extensions are granted access to the DOM which may screw with your site.

Chad Scira
It's a 100% of the time error with Firefox 3, 0% on everything else. I don't believe it to be a problem with jQuery, but as none of the other browsers even raise a warning, I don't believe it to be a problem with my code either.
Macha
got it, read my edit and d03boy's response. its most likely a firefox extension conflict.
Chad Scira