spring拦截器没拦截下来 springurl拦截器 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 url 路径对不。 你跨域了?dataType : "jsonp", 这个controller里面的其他的也是这个路径啊 应该不会错啊 dataType : "jsonp", 是跨域才用的吗? 我是小菜 不是很懂啊,现在还是照葫芦画瓢的...... 你url 直接敲路径,看请求到不。给个例子。 或者打印异常看看。 error: function(XMLHttpRequest, textStatus, errorThrown) { alert(XMLHttpRequest.status); alert(XMLHttpRequest.readyState); alert(textStatus); }, 为什么我点了触发按钮就没有让拦截器截获啊$("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}); $.getJSON("http://test.com//seller/updateTwoDimensionalCode.html&callback=?", function(data) { alert("imageId: " + data.imageId); }); .com//seller 双杠单杠都是有错误,我加在ajax下面的 是我加错地方导致不能打印出错误吗? 不知道你怎么搞,你直接调用 。<!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> 我刚学的java 还没学Struts,用的springMVC 问题解决了,是我不小心改了点东西,jquery也不熟,有时间我还的补起来,谢谢你的热心解答 如何实现文档转换 关于struts2的<s:select>的问题 很奇怪的问题 大侠们看看 散分了 jfreechart中如何在一张页面上画多个饼图 在线等啊,resin问题 <logic:iterate> 问题,请高手帮忙,老是说"Cannot find bean: "ret" in any scope",不知道哪里错了 请问怎样用一个按钮先后提交当前页面的表单和iframe里的表单 请问如何得到数据库中某一列的所有数据? 问几个JAVA中包的使用 IP地址定位。以及如何和本地数据库关联。 Java读取linux系统中文文件名时候乱码 如何对基于restful的接口做压力测试啊。
给个例子。
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
},
为什么我点了触发按钮就没有让拦截器截获啊
$("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
});
alert("imageId: " + data.imageId);
});
.com//seller 双杠单杠都是有错误,我加在ajax下面的 是我加错地方导致不能打印出错误吗?
<!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>