IE9 火狐 一个click 就可以执行完,IE8 IE7 要点两下  才出结果 。什么原因呢? 

解决方案 »

  1.   

    应该不是,就是浏览器兼容的问题, 问题是我现在不知道 IE8 和 IE9  具体区别 。
      

  2.   

     <a id="calculate" rel="quickAdd" href="#addCalculate"  class="link-button" title="###" style="color:#000">###</a><script type="text/javascript">
    window.addEvent('domready', function() {
        $('theForm').getElements("input[name=paymentCode]").addEvent('click', function(e){
            var self = e.target;
            var kuaiqianbank = $('kuaiqianbank');
            var kuaiqianbankSelect = $('kuaiqianbankSelect');
            if (self.get('value') == 'kuaiqianbank') {
                kuaiqianbank.setStyle('display', 'block');
                kuaiqianbankSelect.set('disabled', false);
            } else {
                kuaiqianbank.setStyle('display', 'none');
                kuaiqianbankSelect.set('disabled', true);
            }
        });
        $('calculate').addEvent('click', function() {
            var productAmount = 0;
            $('productSpecList').getChildren('tr').each(function(el){
                productAmount = (el.getElement('input[name^=productSpecPrices]').value) * parseInt(el.getElement('input[name^=productSpecNums]').value).toFloat() + productAmount;
            });        $('packageList').getChildren('tr').each(function(el){
                productAmount = (el.getElement('input[name^=productSpecPrices]').value) * parseInt(el.getElement('input[name^=productSpecNums]').value).toFloat() + productAmount;
            });        var shippingAmount = parseInt($('shippingAmount').value);
            var codChargeRate  = parseInt($('codChargeRate').value);
            var orderRemit = ($('orderRemit').value).toFloat().toFixed(2);
            $('productAmount').set('text', productAmount);
            $('expressAmount').set('text', shippingAmount + codChargeRate);
            $('promotionAmount').set('text', orderRemit);
            
            var couponAmount = 0;        if($('coupon').value != ''){
                new Request.JSON({
                    type: 'post',
                    async:false,
                    url: '/admin/order.php?a=ajaxUseCoupon',
                    onSuccess : function(response) {
                        if(response.result != null){
                            couponAmount = response.result;
                        }
                        $('couponAmount').set('text', couponAmount);
                    }
                }).get({
                    'sn':$('coupon').value,
                    'email':$('email').value,
                    'productId':$('productSpecList').getElements('tr').get('ident'),
                    'packageId':$('packageList').getElements('tr').get('ident'),
                    'packageNum':$('packageList').getElements('input[name^=productSpecNums]').get('value'),
                    'packagePrice':$('packageList').getElements('input[name^=productSpecPrices]').get('value'),
                    'num':$('productSpecList').getElements('input[name^=productSpecNums]').get('value'),
                    'price': $('productSpecList').getElements('input[name^=productSpecPrices]').get('value')
                });
            }
            
            $('totalAmount').set('text', (productAmount + shippingAmount + codChargeRate - couponAmount - orderRemit).toFixed(2));    });
    new Facebox({
                selector:'a[rel=quickAdd]',
                showFooter:false,
                width:'auto',
        
            });
    </script>
      

  3.   

     $('calculate').addEvent('click', function() {
            var productAmount = 0;
            $('productSpecList').getChildren('tr').each(function(el){
                productAmount = (el.getElement('input[name^=productSpecPrices]').value) * parseInt(el.getElement('input[name^=productSpecNums]').value).toFloat() + productAmount;
            });        $('packageList').getChildren('tr').each(function(el){
                productAmount = (el.getElement('input[name^=productSpecPrices]').value) * parseInt(el.getElement('input[name^=productSpecNums]').value).toFloat() + productAmount;
            });        var shippingAmount = parseInt($('shippingAmount').value);
            var codChargeRate  = parseInt($('codChargeRate').value);
            var orderRemit = ($('orderRemit').value).toFloat().toFixed(2);
            $('productAmount').set('text', productAmount);
            $('expressAmount').set('text', shippingAmount + codChargeRate);
            $('promotionAmount').set('text', orderRemit);
            
            var couponAmount = 0;        if($('coupon').value != ''){
                new Request.JSON({
                    type: 'post',
                    async:false,
                    url: '/admin/order.php?a=ajaxUseCoupon',
                    onSuccess : function(response) {
                        if(response.result != null){
                            couponAmount = response.result;
                        }
                        $('couponAmount').set('text', couponAmount);
                    }
                }).get({
                    'sn':$('coupon').value,
                    'email':$('email').value,
                    'productId':$('productSpecList').getElements('tr').get('ident'),
                    'packageId':$('packageList').getElements('tr').get('ident'),
                    'packageNum':$('packageList').getElements('input[name^=productSpecNums]').get('value'),
                    'packagePrice':$('packageList').getElements('input[name^=productSpecPrices]').get('value'),
                    'num':$('productSpecList').getElements('input[name^=productSpecNums]').get('value'),
                    'price': $('productSpecList').getElements('input[name^=productSpecPrices]').get('value')
                });
            }
            
            $('totalAmount').set('text', (productAmount + shippingAmount + codChargeRate - couponAmount - orderRemit).toFixed(2));    });主要是这个 在IE8下面 没有执行!太乱了有点 。。
      

  4.   

    哎呦,你的代码看的我头晕,你的ajax怎么写这么乱
      

  5.   

    楼主你写的是mootools吧,你最好自己在IE8下使用IE DEVELOP 调试下,然后找到错误的语句分析过后,再来把
      

  6.   

    对 是mootools , 是我的写法有问题。。 很久没写JS了。。