1. Well as far as I know, Javascript and jQuery doesn't allow you to do cross domain calls, to protect the website from false calls to web services within your web site. But on the flip side of the coin, I know you cal call card processing services from jquery, so I need to update my knowledge on that. 2. You need to check your script for errors on something like http://www.javascriptlint.com/online_lint.php[^] 3. With Javascript and JQuery, you really need to use the single quote char, and not the double quote char. by using the single quote char to wrap text values, you can use the double quote char without having to escape it e.g.
var html = '
';
I can't tell why it's not working, but you should code it correctly first before moving forward, you could just be getting the error after the first error.
$(document).ready(function () {
2 $.support.cors = true;
3 $.ajax({
4 type: "GET",
5 crossDomain: true,
6 contentType: "application/json; charset=utf-8",
7 // url: "/api/stw",
8 url: "http://apitesting.domain.com/api/stw,",
============================^
SyntaxError: missing } after property list
9 data: "{}",
10 dataType: "json",
11 success: function (data) {
12 console.log(data);
13 // var myData = JSON.parse(data)
14 for (var i = 0; i < data.length; i++) {
15 $("#tbDetails").append("" + data[i].Name + "" + data[i].loan + "" + data[i].evnt + "");
16 }
17 },
18 error: function (result) {
19 alert("Error");
20 }
21 });
22 });