Guest User

Untitled

a guest
Aug 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. JQuery AJAX callback troughs an error
  2. [WebMethod]
  3. public FileInfo[] GetFileInfo(int Id)
  4. {
  5. Proxies.ServiceRef.ServiceClient c = new Proxies.ServiceRef.ServiceClient();
  6. return c.GetFileInfo(Id).ToArray();
  7. }
  8.  
  9. $.ajax({
  10. url: url,
  11. data: jsonData,
  12. type: "POST",
  13. contentType: _I.contentType,
  14. timeout: _I.timeout,
  15. dataType: "serviceproxy", // custom type to avoid double parse
  16. dataFilter: function (jsonString, type) {
  17. if (type == "serviceproxy") {
  18. // Use json library so we can fix up dates
  19. var res = JSON.parseWithDate(jsonString);
  20. if (res && res.hasOwnProperty("d"))
  21. res = res.d;
  22. return res;
  23. }
  24. return jsonString;
  25. },
  26. ***success: function (result) {
  27. if (callback)
  28. callback(result);***
  29. }
  30. error: function(xhr, error).......
  31.  
  32. {"d":[{"__type":"Proxies.AFARServiceRef.AssignmentInfo","ExtensionData":{},"AssignDate":"/Date(1317748587667)/","AssignFileName":null,"ClaimId":"PA026195","ClaimantName":"Rachel Weiss","FirstContactDate":"/Date(1302678000000)/","FirstContactTime":{"Ticks":433800000000,"Days":0,"Hours":12,"Milliseconds":0,"Minutes":3,"Seconds":0,"TotalDays":0.50208333333333333,"TotalHours":12.049999999999999,"TotalMilliseconds":43380000,"TotalMinutes":723,"TotalSeconds":43380},"Id":5257,"InspectionDate":"/Date(1302246000000)/","StatusId":1,"SubmittedCount":5,"UploadedCount":9}]}
  33.  
  34. success: function (result) {
  35. if (callback){
  36. callback(result);
  37. }
  38. },
  39. error: function(xhr, error)
Add Comment
Please, Sign In to add comment