IE7에서 jQuery 코드가 작동하지 않습니다.내 jQuery 코드가 IE7에서 작동하지 않습니다.
IE8, 상위 버전 및 나머지 모든 브라우저에서 작동합니다.
$(document).ready(function() {
$("#ListingPriceFormatted").bind('input propertychange', function() {
$("#listingprice").val($("#ListingPriceFormatted").val().replace("$", "").replace(",", ""));
$("#ListingPriceFormatted").val(formatCurrency($("#ListingPriceFormatted").val(), false));
});
});
function formatCurrency(num, showCents) {
num = num.toString().replace(/\$|\,/g, '');
if (isNaN(num)) num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num * 100 + 0.50000000001);
cents = num % 100;
num = Math.floor(num/100).toString();
if (cents < 10) cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length - (1 + i))/3) ; i++)
num = num.substring(0, num.length - (4 * i + 3)) + ',' + num.substring(num.length - (4 * i + 3));
if (showCents) {
return (((sign) ? '' : '-') + '$' + num + '.' + cents);
}
else {
return (((sign) ? '' : '-') + '$' + num);
}
}
무엇이 잘못 되었나요?
"스크립트 디버깅 사용 중지"등의 선택을 취소하고받은 전체 오류 메시지를 게시하십시오. 그렇지 않으면 우리는 여기 어둡습니다. –