I get this error in IE 11:
Object doesn't support property or method isNaN
JavaScript
jQuery(document).ready(function($) {
var $total = $('#total'),
$value = $('.value');
$firstName = $('#firstname');
$lastName = $('#lastname');
$tour = $('#tour');
$pledge = $('#pledge');
$currency = $('#currency');
$distance = $('#distance');
$riders = $('#riders');
$(':input').on('input change', function(e) {
var total = 1;
$value.each(function(index, elem) {
if(!Number.isNaN(parseFloat(this.value)))
total = total * parseFloat(this.value);
});
$total.val(total/10);
$('#pledgefirstname').text($firstName.val());
$('#pledgelastname').text($lastName.val());
$('#pledgetour').text($tour.val());
$('#pledgepledge').text($pledge.val());
$('#pledgecurrency').text($currency.val());
$('#pledgecurrency2').text($currency.val());
$('#pledgecurrency3').text($currency.val());
$('#pledgecurrency4').text($currency.val());
$('#pledgetotal').text($total.val());
$('#pledgetotal2').text($total.val());
$('#pledgedistance').text($distance.val());
$('#pledgeriders').text($riders.val());
});
});
isNaN
method without calling it fromNumber
object:if (isNaN(...))
.window.isNaN
andNumber.isNaN()
. I think the latter is an EcmaScript 6 feature.Number.isNaN
is a very new and still experimental feature of the next JavaScript spec. It is not supported at all in IE. You've likely confused it with the globalisNaN
function, which has support in all browsers.