weixin_33674976 2016-04-26 04:20 采纳率: 0%
浏览 8

Ajax调用语法错误

I have below code in processor.php to view a image from database on the same page using jQuery ajax method. downloading image part is done on another PHP called solve.php. Image is not shown on same page and firebug errors are;

<head>
  <script type="text/javascript" 
     src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

  <script>
        $(document).ready( function() {
            $(".image-view").click(function(e) {
                e.preventDefault();

                var url = $(this).attr('href'); // Get href attribute of current element
                $.ajax({
                    url: url, // Use url with arguments
                    type: "GET",

                    success: function(data){ //function to be called if request succeeds
                        $("#preview").html(data); // It should be html here
                    }
                });
            }) //line 20
        });
  </script>

screenshot

enter image description here

What is a cause?

SyntaxError: missing } after function body processor.php (line 20, col 5)

SyntaxError: missing } after function body processor.php (line 20, col 5)

SyntaxError: expected expression, got '}' processor.php (line 21, col 2)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料