Color rows doesn't work with Safari
Posted: Wed Oct 31, 2018 10:40 am
Hey,
I have had this JS running and working perfectly under Chrome browser:
It basically colors in red if current date > date value in row, and in green if current date == date value in row.
It doesn't work under Safari browser. Here is the error I get in Safari console:
Error: Syntax error, unrecognized expression: div[id^='nucell_0 error jquery.js:1586
I guess the expression has to be stated differently for Safari, but how?
Thanks
Marc
I have had this JS running and working perfectly under Chrome browser:
Code: Select all
if (nuFormType() == 'browse') {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if(dd<10) {
dd = '0'+dd
}
if(mm<10) {
mm = '0'+mm
}
today = yyyy + '-' + mm + '-' + dd;
$('[data-nu-column="0"]').each(function (index) {
var cellId = $(this).attr('id');
var cellValue = $('#' + cellId).html();
var rowNum = String(cellId).split('_')[1];
if (cellValue < today) {
$("div[id^='nucell_" + rowNum).css("color", "red");
}
if (cellValue == today) {
$("div[id^='nucell_" + rowNum).css("color", "green");
}
});
}
It doesn't work under Safari browser. Here is the error I get in Safari console:
Error: Syntax error, unrecognized expression: div[id^='nucell_0 error jquery.js:1586
I guess the expression has to be stated differently for Safari, but how?
Thanks
Marc