Skip to main content

.color JQuery not working in Chrome/Safari



I have a piece of jquery which is working fine on firefox and ie but not working in chrome and safari





here it is







if (intCurrPortionId == intOldPortionId) {

$('#' + portionCell + '').css("backgroundColor", "green");

} else {

$('#' + portionCell + '').css("backgroundColor", "red");

}







and this is not working.. m calling this jquery on checkbox onchange event





EDIT: It is not executing the function in chrome and safari.. i added the alert in the code and found out that no alerts were popping... now how to tackle it


Comments

  1. $('#' + portionCell).css("background-color", "green");

    ReplyDelete
  2. Try using background-color:

    if (intCurrPortionId == intOldPortionId) {
    $('#' + portionCell + '').css("background-color", "green");
    } else {
    $('#' + portionCell + '').css("background-color", "red");
    }


    FYI, using javascript style parameter names (like backgroundColor) works fine for me here in Safari 5.1.2 and Chrome 16:

    Test fiddle

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?