I've been struggling with a strange syntax error since yesterday: The FF debugger keeps saying "SyntaxError: illegal character" at this specific line :
function newTimePeriod(ID, param, paramID, unit)
{
updateSession();
//check if date
//(I got this regex from another post)
var re = new RegExp("^\\d{4,4}(-\\d{1,2}){1,2}( \\d{1,2}(:\\d{1,2}){1,2})?$");
var dateFrom = document.getElementById("chart_date_min_" + ID).value;
var dateTo = document.getElementById("chart_date_max_" + ID).value;
var fromCorrect = re.test(dateFrom);
var toCorrect = re.test(dateFrom);
/**/if (fromCorrect && toCorrect){/**/ //return illegal character
LoadGraph(ID, param, paramID, unit, dateFrom, dateTo);
}
}
I tried to include this script into the main php page, or separate it; it doesn't change a thing. Charset used is UTF-8, and fromCorrect and toCorrect returns booleans correctly (the regex is working)
When I remove the if statement the script is loading... Notepad++ doesn't show any special characters hiding anywhere.
Any thoughts?