【发布时间】:2014-04-15 19:42:52
【问题描述】:
我来了
ReferenceError: 数据未定义 和
>NetworkError: 500 Internal Server Error - http://localhost/WebApplication2/js/test.aspx"
但是我的 aspx 页面在正确的目录中
我做了所有这些来消除内部服务器错误:
http://pcsupport.about.com/od/findbyerrormessage/a/500servererror.htm
代码按照教程
Index.html(回调数据会放在这里)
<body>
<input id="button" type="submit" value="Go" />
<div id="feedback"> </div>
</body>
这是我的 Ajax 方法:
$('#button').click(function () {
$.ajax({
type: "POST",
url: "test.aspx",
data: {"name=" + name},
success: function (data) {
$("#feedback").html(data);
}
});
});
test.aspx
<form id="form1" runat="server">
<div>
<%Response.Write(Request.Form["name"].ToString()); %>
</div>
</form>
类似的帖子:
ajax and “Uncaught ReferenceError: data is not defined”
$.ajax() and "Uncaught ReferenceError: data is not defined"
Ajax data - Uncaught ReferenceError: date is not defined
编辑:JSLint /JSHint /SharpLinter 对于检测语法错误仍然没有多大帮助。我需要一些语法检查建议
也存在放置数据类型参数的问题.. 这不是我的情况。
我在那里找不到简单的东西..请建议
【问题讨论】:
-
我在给定的代码中看不到任何可能导致该错误的内容。
-
发布 xhr 响应的原始文本。您可以使用 fiddler 或 chrome 开发工具来获得它。
-
好的。我在使用 chrome 开发工具 .. 你能告诉我确切的选择吗?
-
在控制台我收到此错误:NetworkError: 500 Internal Server Error - localhost/WebApplication2/js/test.aspx" ..但我的页面在正确的目录中
-
500 不是 404。您的
test.aspx抛出错误。
标签: javascript jquery html ajax