阿贾克斯请求

{#注意这里面各个字段的写法#}
1
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script> 2 <script> 3 $('#b1').click( 4 function () { 5 $.ajax({ 6 url: '/calc/', 7 type: 'post', 8 data: { 9 a: $('[name="a"]').val(), 10 b: $('[name="b"]').val(), 11 hobby: JSON.stringify(['test1', 'test2', 'test3']), 12 }, 13 success: function () { 14 $('[name="c"]').val() 15 16 } 17 }) 18 } 19 ) 20 21 </script>

猜你喜欢

转载自www.cnblogs.com/gaofeng-d/p/10635060.html
今日推荐