Is Javascript breaking Firefox?

About 5 times in the last 6 months, in complex javascripts, I only get an error in firefox (IE6, 7, 8, Chrome, Safari, Opera are okay) resulting in nothing happening in my javascript.

There will be no error messages in the console, and according to Firebug, all my scripts are completely empty. Reloading and clearing the cache doesn't help. I usually just go back to the previous version when this happens and start over with my last changes.

  • This happens most often in Firefox 3. It happens slightly in FF2 and FF3.5b, but not to the same extent.
  • The only general reference I have found is for all the changes related to modifying the code that was run in the jQuery $ (document) .ready () method.
  • On two occasions, this caused the browser to block and crash.
  • None of the other browsers even report a warning in the error log.

Has anyone else noticed this? Is there a specific reason? Or is there a bug in firefox?

EDIT: latest change to kill firefox

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]};

      

For

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 is nothing significant 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 any other browser I've tested as well.

+1


a source to share


2 answers


Do you have console enabled in firebug? I ran into a problem like this yesterday where nothing happened until I turned on the console. Very strange.

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



Edit:

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

+3


a source


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



also you should test a clean install of firefox (as well as any other browser) firefox extensions are given DOM access which may depend on your site.

+1


a source







All Articles