I've got some jQuery that is successful in hitting an endpoint, here's my code
$.ajax({
dataType: "json",
type: "GET",
url: "https://url.that-works.com/env/Development/GetDevs/",
username: "username",
password: "password",
data: "callback=?"
})
.done(function (data) {
alert("success");
})
;
The code returns the following JSON response - which I can see in Chrome Developer Tools:
{
"developments": [
{
"name": "h2010 Ph2"
},
{
"name": "The Meadows Ph2"
},
{
"name": "h2010 Ph3"
},
{
"name": "h2010 Ph4"
},
{
"name": "The Meadows Ph3"
}
]
}
I've checked that this is valid JSON being returned, but I keep getting an error message: Uncaught SyntaxError: Unexpected token :
I'm not sure what exactly I'm doing wrong here or why I'm getting this message, any guidance would be really appreciated.
bengrah.