Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE 7 expected identifier, string or number

Im having a problem and cant seem to find it for the life of me because my code works in all other browsers except IE7. This is the error im getting "expected identifier, 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 seem to be where I have my animate function which is...

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

any help is greatly apprecaited.

like image 716
user874185 Avatar asked Dec 06 '22 17:12

user874185


1 Answers

IE is confused by the extra comma:

Change:

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

To:

height: '365px' }, 500 );
like image 166
Mike Christensen Avatar answered Dec 10 '22 12:12

Mike Christensen