0

IE9、Chrome、Firefoxなどで正常に動作する特定のjQueryがありますが、IE8は特に気に入らないようです:

<script type="text/javascript">
    $("#bandwidth").ForceNumericOnly();    
    $("#bandwidth").on("input", function() {
        var total = this.value*0.18;
        $('#total').val('£'+ total.toFixed(2));
    });
</script>

これは、帯域幅入力から入力を取得し、それに応じて計算し、合計入力に書き込みます。接頭辞は £ です。

入力に対して計算を実行していないようで、本当に混乱しています。

4

2 に答える 2

0

IE8 の場合、keyup キーダウン イベントまたは propertychange イベントの組み合わせが必要な場合があります。入力イベントのように機能し、IE6+ から追加されました。

たぶんこれが役立ちます:

http://jsbin.com/okusov/2

$(function(){
    $('#helloMama').on('propertychange', function(e){
      var $this = $(this);
      $('#output').text("cought by IE6+ :"+$this.val());
    });
    $('#helloMama').on('input', function(e){
      var $this = $(this);
      $('#output').text("cought by smarties: "+$this.val());
    });
 }); 
于 2013-08-01T11:31:14.433 に答える