jsonp can't return data
See original GitHub issuei use the jsonp methods like this:
this.$http.jsonp("http://news-at.zhihu.com/api/4/news/latest").then(
(response) => {console.log(response)},
(response) => {alert(response.json()); }
);
but it return error :
Issue Analytics
- State:
- Created 7 years ago
- Comments:5
Top Results From Across the Web
Can't get any data back using JSONP when making a cross ...
I have a website that I need to send a GET request to from my browser and get HTML data back. But the...
Read more >How to Use the Fetch API (Correctly) - CODE Magazine
Navigate into the folder Samples-WebAPI and load that folder in Visual Studio Code or Visual Studio 2019. Open the appsettings.json file and ...
Read more >jQuery.ajax() | jQuery API Documentation
The function accepts two arguments: The raw data returned from the server and the 'dataType' parameter. dataType (default: Intelligent Guess (xml, json, script, ......
Read more >JavaScript, fetch, and JSON — Flask Documentation (2.2.x)
It is usually not a good idea to return file data in a JSON response. JSON cannot represent binary data directly, so it...
Read more >fetch-jsonp - npm
Fetch JSONP like a boss using Fetch API. Latest version: 1.2.3, last published: 3 months ago. Start using fetch-jsonp in your project by ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
it seems like that this
http://news-at.zhihu.com/api/4/news/latest
api just not support jsonp.try this:
Calling the
GET
method and passing the JSONP callback name as a parameter seems to do the trick for me. Here is a working example:Note it does not matter the callback name as the library would parse it automatically into a JSON object.