Ajax get method does not work

Viewed 1513

I have a problem, I am getting json data from an API,

  $.ajax({
    url: request,
    type: "get",
    contentType: "application/json; charset=utf-8",
    dataType: "jsonp",
    success: function (data) {
        if (data.ResultCode==="200") {
            console.log(data.Result[0]);
        }
        else if (data.ResultCode !== "200") {
            myApp.alert(data.ResultDesc, "");
        }

    },
    error: function () {
        console.log("your call failed");
        myApp.alert("Sunucuya erişilemiyor.","");
    }
});

this is my code I wrote, I have an error like

Uncaught SyntaxError: Unexpected token :

url is correct, I can't see the problem.

1 Answers
Related