将 Web 应用程序移动到 win 服务器 2003 时,JQuery 帖子不起作用
我使用 ASP.NET MVC 和 JQuery 构建了一个 Web 应用程序。在我的本地计算机上,这工作正常,但是当将其移动到 Windows Server 2003 时,JQuery 方法帖子停止工作。我也在使用 load 方法,效果很好。
function methodOne(id) {
alert("debug1: <%= Url.Action( "MethodOne", "controller" ) + "/" %>" + id);
$.post <%= Url.Action( "MethodOne", "controller" ) + "/" %>" + id, function(data) {
alert("debug2");
...
} else {
alert("Debugg: Add presentation to user failed");
}
});
}
debug2 永远不会输出。
$('#panel').load("<%= Url.Action("方法", "控制器") %>");
工作正常。
I have build a webapplication using ASP.NET MVC and JQuery. On my local machine this works fine,but when moving it to a Windows server 2003 the JQuery method post stops working. I'm also using the load method and this works fine.
function methodOne(id) {
alert("debug1: <%= Url.Action( "MethodOne", "controller" ) + "/" %>" + id);
$.post <%= Url.Action( "MethodOne", "controller" ) + "/" %>" + id, function(data) {
alert("debug2");
...
} else {
alert("Debugg: Add presentation to user failed");
}
});
}
The debug2 is never outputed.
$('#panel').load("<%= Url.Action( "Method", "Controller" ) %>");
Works fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 post 函数有错误:缺少左括号和引号。还可以尝试传递一个空数据作为第二个参数,看看这是否有效:
You have an error in your post function: opening parenthesis and quotes are missing. Also try passing an empty data as second argument to see if this works: