angularjs - how to get results of my webservice with jsonp? -
I want to call one of my web server through jsonp. / code> code> $ http.jsonp ('http://example.com/files?callback=JSON_CALLBACK') .Service (data) {console.log (data); $ scope .folders = data;}); console.log is not showing up .... what am I doing? My Web service returns JSON_CALLBACK (["folder1", "folder2"]) ? Should I do it manually in my API? Browser does not do this automatically? You are currently returning ( ["folder1", "folder2"] ) is not valid. The JSON result should be wrapped up with the Javascript function call to be JSONP. For example, when you use URLs like this: http: // example.com/files?callback=JSON_CALLBACK Angular function will replace the JSON_CALLBACK parameter with the function name (built internally) such as: http://example.com/ Files? Callback = angular.callbacks._0 Then your server will need to be able to read that callback parameter and return results ...