Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
644 views
in Technique[技术] by (71.8m points)

javascript - 无法加载资源:服务器在绑定功能中响应状态为500(内部服务器错误)[关闭](Failed to load resource: the server responded with a status of 500 (Internal Server Error) in Bind function [closed])

I'm trying to send a call using ajax but in Chrome it is rising error but in firefox there is no error.(我正在尝试使用ajax发送呼叫,但在Chrome中它出现上升错误,但在Firefox中没有错误。)

But still it can't calling the method.(但它仍然无法调用该方法。) I tried to record my call in firebug but there is no call request in firebug.(我试图用萤火虫记录我的电话,但是萤火虫没有电话请求。) So that's the reason there is no error in firefox.(所以这就是firefox中没有错误的原因。) (Index.chshtml) code is below((Index.chshtml)代码如下) function onLoad(e) { var grid = $(this).data("tGrid"); //bind to the context menu of the Grid's header event.preventDefault(); $(this).find(".t-grid-header").bind('contextmenu', function (e) { //wait for the menu to be generated setTimeout(function () { // bind to the checkboxes change event. The context menu has ID in the format "GridName" + "_contextmenu" $('#globalsearchgrid_contextMenu :checkbox').change(function () { debugger; var $checkbox = $(this); // the checked state will determine if the column has been shown or hidden var checked = $(this).is(":checked"); // get the index and the corresponding column from the Grid's column collection var columnIndex = $(this).data("field"); var request = "{'columnIndex':'" + columnIndex + "'value':'" + checked + "'}"; $.ajax({ type: "POST", url: "../../GlobalSearch/SaveColumnInfo", data: request, contentType: "application/json; charset=utf-8", dataType: "json", success: function (msg) { }, error: function (xhr, status, error) { alert(error.responseTextss); } }); }); }); }); } (Controller method)((控制器方法)) public JsonResult SaveColumnInfo(string columnIndex, string value) { CookieHelper helper=new CookieHelper(); helper.UpdateCookie(int.Parse(columnIndex), value.ToString()); return Json("Success"); } (Error in chrome)((chrome中出错)) POST http://localhost:3577/GlobalSearch/SaveColumnInfo 500 (Internal Server Error) jQuery.ajaxTransport.send jQuery.extend.ajax (anonymous function) jQuery.event.handle jQuery.event.add.elemData.handle.eventHandle   ask by Haris translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The 500 code would normally indicate an error on the server, not anything with your code.(500代码通常表示服务器上有错误,而不是代码中的任何错误。)

Some thoughts(一些想法) Talk to the server developer for more info.(与服务器开发人员联系以获取更多信息。) You can't get more info directly.(您无法直接获得更多信息。) Verify your arguments into the call (values).(验证调用中的参数(值)。) Look for anything you might think could cause a problem for the server process.(寻找您认为可能导致服务器进程出现问题的任何内容。) The process should not die and should return you a better code, but bugs happen there also.(这个过程不应该死,应该给你一个更好的代码,但是那里也会发生错误。) Could be intermittent, like if the server database goes down.(可能是间歇性的,就像服务器数据库发生故障一样。) May be worth trying at another time.(可能值得在另一个时间尝试。)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...