weixin_33717298 2017-07-21 08:47 采纳率: 0%
浏览 17

如何将jQuery代码转换为Ajax?

能将下面的jQuery代码转换为Ajax吗?

<script type="text/javascript">
    $j(document).ready(function () {
        $j("#co-shipping-method-form .buttons-set button.button").click(function () {
            var shippingSelectedValue = $j("input[name='shipping_method']:checked").val();
            if(shippingSelectedValue == 'freeshipping_freeshipping' ){
           $j("#customtest_modal_id").show();
            }
        });
        $j("a.reset-customtest").click(function () {
            $j("#customtest_modal_id, #checkout-step-shipping_method").show();
            $j("#checkout-step-payment").hide();
        });

    });

</script>
  • 写回答

2条回答 默认 最新

  • weixin_33681778 2017-07-21 08:57
    关注

    I think you misunderstand concept of AJAX.

    Here are things AJAX can do for you: - Read data from a web server - after the page has loaded - Update a web page without reloading the page - Send data to a web server - in the background

    In short, AJAX is a way to transport data via XML

    评论

报告相同问题?