user3292394 user3292394 - 17 days ago 5
Ajax Question

SyntaxError: missing ) after argument list JS

I'm new enough to ajax calls and JS, i'm getting the the above error.
I have read other questions with this error and still can't find an answer.
Could some one please help me and tell me what I am doing wrong.

$scope.getOrgInfo = function(resEmailID) {

$http
.get('http://peoplefinder-api.pf.g4ihos.itcs.hpecorp.net/v1.0/person/mgr/' + resEmailID)
.success(function(result) {

$scope.orgInfo = result.result;
var Org_table = "";
for (var i = 0; i < result.result.length; i++) {
Org_table += "<tr><td><img src='" + result.result[i][0].hpPictureThumbnailURI + "' </img></td><td>" + result.result[i][0].cn + "</td><td>" + result.result[i][0].uid + "</td></tr>";
}
$("#Chart_Table").append(Org_table);
alert("working");
}
}

Answer

Try:

$scope.getOrgInfo = function(resEmailID) {

    $http.get('http://peoplefinder-api.pf.g4ihos.itcs.hpecorp.net/v1.0/person/mgr/' + resEmailID)
        .success(function(result) {

                $scope.orgInfo = result.result;
                var Org_table = "";
                for (var i = 0; i < result.result.length; i++) {
                    Org_table += "<tr><td><img src='" + result.result[i][0].hpPictureThumbnailURI + "' </img></td><td>" + result.result[i][0].cn + "</td><td>" + result.result[i][0].uid + "</td></tr>";
                }
                $("#Chart_Table").append(Org_table);
                alert("working");
            })
    }