I am new to Ajax and trying to fill a table with the data coming from a server.
Here is my GET function:
<script type = "text/javascript" charset="utf-8">
$(document).ready(function () {
$.ajax({
type: "GET",
url: "myURL",
dataType: "jsonp",
success: function (response) {
debugger;
var trHTML = '';
$.each(response, function (i, v) {
// append to table
trHTML += '<tr><td>' + v.Ticker+
'</td><td>' + v.Close+
'</td><td>' + v.percentage+
'</td></tr>';
});
$("#art").append(trHTML);
},
error: function (e) {
debugger;
console.log(e)
alert(e + " Error");
}
});
});
</script>
Incoming data falls into Error every single time and it is like:
e = Object {readyState: 4, responseText: "{"Ticker":"akbnk.is","Close":6.74,"percentage":-1…s","Close":1.54,"percentage":9.2198581560283781}]", s
I can see this much on Chrome. Does anybody know how to fix this?