jquery - JsonP returning "Uncaught SyntaxError: Unexpected token :" AngularJS - routingnumbers.info -


I researched this question on a ridiculous amount and hoped that someone could help in the diagnosis of being wrong .

I have already seen the following questions: (So, due to fame, I do not allow to post more than 2 links, so I have only included paths).

  • Among many other people ......

    Things I've tried: I at the end of the URL & amp; Callback = JSON_CALLBACK has been added. I've changed the config settings like response type: 'JSON' . I have reorganized the http.jsonp request several times to ensure that this programmatic / text ( http ({}) and http.jsonp was not

    Here's what I'm trying to do: Get information from routingnumbers.info/api/ using an angular JSP request (server call permissions I do not.) I am able to successfully request with jQuery, but I successfully build it with Coyon I'm unable to.

    The related test is here:

    As you can see, I get two errors:

    1. The resource was interpreted as a script, but the mime type was moved with text / plain: "". unlock syntax error: unexpected token:

      But if you check the response to Chrome devtools - NETWORK, then this is true: However I know that jsonp jsonpfunction ("MyJso N ":" data "}), where it resides there.

      Here is the original code:

        // $ scope.number = '071000013'; Var Routing API URL = 'https://routingnumbers.herokuapp.com/api/data.json?rn=' + $ scope.number; $ Http ({method: 'jsonp', url: routingApiUrl + 'and callback = JSON_CALLBACK', feedback type: "json"}). Success (work (data) {console.log ('successful:' + data);}). Error (function (data) {console.log ('error:' + data);});   

      Has the API used with this angular? I am thinking that I can do something to modify the header (without jquery), but I have not received any information. I am also thinking that this can be a server issue (though, if it is working properly in jquery, this problem will not be there). It may be something with HTTPS

      TL: DR - Angular JSONP request is not working, but with the same URL, jQuery JSONP requests work Has been doing.

      Edit: Some punctuation and accessories.

      Div>

      Consistent to this question: angular.callbacks. Try adding _0 (JSON) around your server side Jason. It worked for me

      It was a plunker

  • Comments

    Popular posts from this blog

    php - PDO bindParam() fatal error -

    logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

    java - Why my included JSP file won't get processed correctly? -