3

I am working in local and I just updated firebug to the new version. Before the update whatever error that I was making with js, firebug was showing me on which line wasn't working the code (so I could understand where I did the mistake).

Now my website breaks, but I don't receive any message about JS not working from firebug. Is there something changed? Script is enabled.

this is the code

$("#cv").hover(
    // when the mouse enters the box do...
    function(){
        $("#hover-cv").css("z-index":"6");
        aniCircle(1, $(this), "#hover-cv", {scale:"1", "opacity":"0"}, {scale:"1.3", "opacity":"1"});
    },
    // when the mouse leaves the box do...
    function() {
        $("#hover-cv").css("z-index":"4");
        aniCircle(0, $(this), "#hover-cv", {scale:"1", "opacity":"0"});
    }
);

what is creating the error are the scripts "$("#hover-cv").css("z-index":"6");" and "$("#hover-cv").css("z-index":"4");"

I don't understand why Firebug doesn't warn me that something is wrong. More than the solution, I am worried about firebug not warning me on js errors.

Littlemad
  • 700
  • 1
  • 7
  • 19

1 Answers1

0

You either need a comma for the single .css(property, value) version:

$("#hover-cv").css("z-index","6");

Or object notation (with the missing {}) for the property map version .css(props):

$("#hover-cv").css({"z-index":"6"});
                   ^  missing    ^

I am seeing the same behavior in FireBug 1.6 as you not reporting this, can't find any mention of the bug in the issues list though.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155
  • Thx for the anser, I will rephrase the question, the problem is not my wrong JS, it is firebug that doesn't let me know where is the error – Littlemad Dec 02 '10 at 13:01
  • @Littlemad - you may be right, the syntax isn't quite valid here on the same line, (without the implicit new command), looks like it's a FireBug 1.6 error. – Nick Craver Dec 02 '10 at 13:08
  • @Littlemad - After killing Firefox completely and testing it works, can still lock up at time though, seems like a bug in FireBug that locks up and needs a complete reload before it listens for errors properly again. – Nick Craver Dec 02 '10 at 13:26
  • No I didn't report it, I wanted to be sure that I wasn't the only one to have this problem. Where is the place to report it? (In mainwhile I do reload to listen to error? just a refresh page?). I am switching back to 1.5.4 for the moment http://getfirebug.com/releases/firebug/1.5/ . – Littlemad Dec 02 '10 at 17:33
  • As Nick Craver already said, you can report Firebug bugs at http://code.google.com/p/fbug/issues/list. Include a complete test case and we'll fix it. – johnjbarton Dec 02 '10 at 17:42
  • Nick I switched back to the old version, and $("#hover-cv").css({"z-index","4"}); throw me an error. So remove it from your answer. "{" "}" are not needed ;) – Littlemad Dec 02 '10 at 17:49
  • @Littlemad - Look closer :) it's either `{prop: name}` (notice the `:`) *or* with a comma. – Nick Craver Dec 02 '10 at 17:53