你好,我有一个问题:
当我使用JSONP我的本地计算机,一切都很好,但是当我在我的服务器上运行它,它让我看到了错误的Ajax调用
下面我显示错误的代码和细节:发送呼叫参数JSONP不工作的服务器
$.ajax({
data: { info: JsonString },
contentType: 'application/json; charset=utf-8',
dataType: "jsonp",
/*url: jsondata.Ruta + "/LanzarAplicativo/",*/
url: 'http://localhost:1143/contenido/LanzarAplicativo/',
success: function (result) {
console.log(result);
},
error: function (xhr, status, error) {
//some code
}
});
这是在阿贾克斯规定的方法
[HttpGet]
public ActionResult LanzarAplicativo(string info)
{
Informacion info;
info = JsonConvert.DeserializeObject<Informacion>(info);
Session["miContexto"] = informacion ;
//some code
return View();
}
当我这样做同样的改变,但在AJA的网址X(在我的IIS服务器的URL)铬控制台抛出我下面的错误:
Failed to load resource: the server responded with a status of 404 (Not Found) http://someUrlmyserver/Plataform/Demo/Contenido/LanzarAplicativo/…%2C%2232%22%3A%22calipso%22%2C%2233%22%3A%22summer%22%7D%7D%7D%7D&_=1382717706500
这个URL是很长的,由于参数的个数附带在Ajax调用。
我想问题可能是因为URL的大小,但这个问题也应该去,因为我在我的本地
任何想法运行?
感谢
你是否在配置中包含了http get和post协议? – Saranya