Home JQuery Ajax , why in success i have error why?
Reply: 0

JQuery Ajax , why in success i have error why?

user10136
1#
user10136 Published in September 19, 2018, 3:17 am

Why in success I have error?

$('#ck').click(function() {
  var StudentData = [{
    'Name': 'Ali',
    'Age': 27
  }, {
    'Name': 'Sam',
    'Age': 32
  }];

  $.ajax({
    url: "/Home/StudentInfo",
    data: JSON.stringify(StudentData),
    ...
    success: function(response) {
      alert(response[0].Name);
    },
    error: function() {
      alert("error");
    },
  });
});
share|improve this question

closed as off-topic by Milan Chheda, guradio, David, Pete, Mohammad Usman Nov 14 '17 at 14:52

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Milan Chheda, guradio, Pete, Mohammad Usman
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Your question is a mess. Please take a look at stackoverflow.com/tour and take some time before re-writing your question. – Nepho Nov 14 '17 at 14:13
  • 2
    What error? What are you talking about? Try to understand that we can't see your screen from here. Explain the problem. – David Nov 14 '17 at 14:13
  • alert(response[0].Name); // error here ... and how i can get value??! – mahmod nasser Nov 14 '17 at 14:15
  • This tells us absolutely nothing. At least add the error you see. – Master Yoda Nov 14 '17 at 14:16
  • 1
    My guess is response isn't an array – Pete Nov 14 '17 at 14:19

1 Answer 1

active oldest votes
up vote 0 down vote accepted
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.302115 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO