javascript - Deal with not valid Json result in jsonp request -
i should send cross browser request , result.so use jsonp
request.
my result is:
response: success message: authentication accepted
but problem server returns json
not valid , uncaught syntaxerror: unexpected identifier
. use angularjs,jquery , implement request.
var ud = 'json' + (math.random() * 100).tostring().replace(/\./g, ''); window[ud] = function (o) { success && success(o); }; document.getelementsbytagname('body')[0].appendchild((function () { debugger; var s = document.createelement('script'); s.type = 'text/javascript'; s.src = url.replace('callback=?', 'callback=' + ud); return s; })());
but same result how can handle problem.
Comments
Post a Comment