IE 7 expected identifier, string or number

I have a problem and cannot find it for life, because my code works in all other browsers except IE7. This is im error getting "expected id, string or number"

This is my code.

function calculate() { var principal = document.loandata.principal.value; var interest = document.loandata.interest.value / 100 / 12; var payments = document.loandata.years.value * 12; var x = Math.pow(1 + interest, payments); var monthly = (principal*x*interest)/(x-1); if (!isNaN(monthly) && (monthly != Number.POSITIVE_INFINITY) && (monthly != Number.NEGATIVE_INFINITY)) { document.loandata.payment.value = round(monthly); document.loandata.total.value = round(monthly * payments); document.loandata.totalinterest.value = round((monthly * payments) - principal); } else { document.loandata.payment.value = ""; document.loandata.total.value = ""; document.loandata.totalinterest.value = ""; } } function round(x) { return Math.round(x*100)/100; } jQuery(document).ready(function ($) { $('#button').click(function(){ $('#option2').animate({ height: '365px', }, 500 ); }); }); 

But the problem is that I have my animation function, which ...

 jQuery(document).ready(function ($) { $('#button').click(function(){ $('#option2').animate({ height: '365px', }, 500 ); }); }); 

any help greatly appreciated.

+4
source share
2 answers

IE gets confused by an extra comma:

Edit:

 height: '365px', }, 500 ); 

To:

 height: '365px' }, 500 ); 
+11
source

remove the comma after "365px"

+4
source

Source: https://habr.com/ru/post/1390700/


All Articles