I have been trying to find ways to solve the problem. Firebug said syntax error, and JSHint is saying “Expected an identifier and instead saw ‘var’.” on line 4 (var test1 = [) Could you tell me why this error is taking place? Thanks!
function name() {
if (
var test1 = ['selected': -1, 'AF': 0.02];
var selectedTest1 = $('#test1').val();
var rate = rates(selectedTest1);
var callMinutes = document.calc.minutes.val();
document.calc.pay.value = selectedTest1 * callMinutes;)
else(
(document.calc.test1.value == null) || (document.calc.minutes.value == null || document.calc.minutes.value.length == 0)) {
document.calc.pay.value = "Incomplete data";
}
};
It is not valid to put a
varstatement inside anifcondition. That aside, your code can be boiled down to:The code is completely invalid.