解决方案 »

  1.   

    url 路径对不。 你跨域了?dataType : "jsonp", 
      

  2.   

    这个controller里面的其他的也是这个路径啊  应该不会错啊  dataType : "jsonp", 是跨域才用的吗?  我是小菜  不是很懂啊,现在还是照葫芦画瓢的......
      

  3.   

    你url 直接敲路径,看请求到不。

    给个例子。
      

  4.   

    或者打印异常看看。
       error: function(XMLHttpRequest, textStatus, errorThrown) {
                            alert(XMLHttpRequest.status);
                            alert(XMLHttpRequest.readyState);
                            alert(textStatus);
                        },
      

  5.   


    为什么我点了触发按钮就没有让拦截器截获啊
    $("button[name='updateBtn']").on("click",function(){
    var thisBtn = $(this).parents("tr");
    var productId = thisBtn.find("#productId").val();
    $.ajax({
            type : 'post',
    url : "/seller/updateTwoDimensionalCode.html",
    dataType : "jsonp",
    jsonp : "callback",
    async : "false",
    data : {
     "productId": productId
    },
    success : function(data) {  
    if(data.result=="ok"){             
         $("#twoDimensionalCode").attr("src","/seller/image/get.do?imageId=" + data.imageId); 
         alert("---------");
       }
       else{
             alert(data.msg);
           }       
    }
             });//ajax
    });
      

  6.   

     $.getJSON("http://test.com//seller/updateTwoDimensionalCode.html&callback=?", function(data) {  
                alert("imageId: " + data.imageId);  
            });
      

  7.   


    .com//seller  双杠单杠都是有错误,我加在ajax下面的  是我加错地方导致不能打印出错误吗?
      

  8.   

    不知道你怎么搞,你直接调用 。
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
    transitional.dtd">
    <html>    
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
            <title>
                xxx
            </title>
            <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
            </script>
            <script type="text/javascript">          $.getJSON("http://www.geonames.org/postalCodeLookupJSON?postalcode=10504&country=US&callback=?", function(json) {  
                for (var e in json.postalcodes[0]) {                       
                                document.write(e + "--->" + json.postalcodes[0][e]+"<br/>");                            
                            }
            }); 
            </script>
        </head>
        
        <body>
          
        </body></html>
      

  9.   

    我刚学的java  还没学Struts,用的springMVC
      

  10.   

    问题解决了,是我不小心改了点东西,jquery也不熟,有时间我还的补起来,谢谢你的热心解答