<script type="text/javascript"><!-- $('#button').bind('click', function() { $.ajax({ url: 'index.php?route=agag/agag1/send', type: 'post', data: $('#payment :input'), dataType: 'json', beforeSend: function() { $('#button').attr('disabled', true); $('#payment').before('<div class="attention"><img src="/image/loading.gif" alt="" /> <?php echo $text_wait; ?></div>'); }, complete: function() { $('#button').attr('disabled', false); $('.attention').remove(); }, success: function(json) { if (json['error']) { alert(json['error']); } if (json['success']) { location = json['success']; } } }); }); //--></script>
php ajax
最新推荐文章于 2024-11-12 12:12:08 发布
本文介绍了一种使用Ajax技术优化在线支付流程的方法。通过在用户提交支付信息后使用Ajax发送异步请求,不仅可以提高用户体验,还能及时反馈错误信息并进行处理。文章详细展示了如何设置Ajax请求、处理响应数据及前后端交互的过程。
1291

被折叠的 条评论
为什么被折叠?



