K
K
Karina2015-10-01 12:17:44
Angular
Karina, 2015-10-01 12:17:44

How to get rid of SyntaxError: Unexpected token v?

simple post:

$http.post('main.php', { uid: $scope.uid, avatar: $scope.avatar } ).success(function (data) {
         console.log(data);
});

always gets this error: SyntaxError: Unexpected token v
How to get rid of this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2015-10-01
Protko @Fesor

look at what comes from the server, apparently this is a JSON parsing error, because the code seems to be all right (except for using the scope, calling $http from the constructor...)

M
Mikhail Osher, 2015-10-01
@miraage

I will assume that you copy-pasted something somewhere using ctrl / cmd + v and once again inserted the letter by releasing the control key.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question