我收到上述错误。我检查了我的语法。代码中似乎没有任何遗漏。1 <script language="javascript" type="text/javascript"> 2 $(document).ready(function(){ 3 4 $('#submit').on('click',function(){ 5 var from_date = $('#from_date').val(); 6 var to_date = $('#to_date').val(); 7 $.ajax({ 8 type:'POST', 9 url:'date_based_report_action.php', 10 data:'from_date='+from_date+'&to_date='+to_date, 11 success:function(html){ 12 alert(html); 13 $('#tabledata').html(html); 14 } 15 }); 16 } 17 }); 18 </script>当我检查控制台时,错误显示在第 16 行。
1 回答

莫回无
TA贡献1865条经验 获得超7个赞
在第 16 行广告这个);,您缺少关闭函数 $('#submit').on('click',function(){ 完整代码如下:
<script language="javascript" type="text/javascript">
$(document).ready(function() {
$('#submit').on('click', function() {
var from_date = $('#from_date').val();
var to_date = $('#to_date').val();
$.ajax({
type: 'POST',
url: 'date_based_report_action.php',
data: 'from_date=' + from_date + '&to_date=' + to_date,
success: function(html) {
alert(html);
$('#tabledata').html(html);
}
});
});
});
</script>
- 1 回答
- 0 关注
- 146 浏览
添加回答
举报
0/150
提交
取消