$.ajax({
url: "/condividi.php",
dataType: "json",
data: {
res: osrm_result
},
success: function(data, textStatus, jqXHR) {
alert("ciaociao");
window.open("https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2F52.16.81.189%2Findex_gen.html&src=sdkpreparse");
}
});
这会触发错误:Url太长了 我怎么能纠正这个让它发挥作用
答案 0 :(得分:0)
jQuery使用的默认方法是GET,它具有有限的数据长度, 尝试通过POST发送数据(您当然应该相应地更新condividi.php以提供POST请求):
$.ajax({
type: "POST",
url: "/condividi.php",
dataType: "json",
data: {
res: osrm_result
},
success: function(data, textStatus, jqXHR) {
alert("ciaociao");
window.open("https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2F52.16.81.189%2Findex_gen.html&src=sdkpreparse");
}
});