JSONP request gives 404 in Angular app

前端 未结 2 825
我在风中等你
我在风中等你 2021-01-05 05:48

I\'m trying to get some data from an API with a JSONP request, but I get a 404 every time. I would assume my URL is wrong, but I can hit the URL manually in Chrome and get t

2条回答
  •  走了就别回头了
    2021-01-05 06:31

    can you provide the exact content of window.console.log(siteNameUrl) just before your ajax request and provide the result ?
    Maybe try a siteNameUrl.toString() just in case it's a parsing problem
    it seems that you're not requesting the exact same url...
    Try even putting hard written the siteNameUrl you're using as siteNameUrl="www.someapi/api"

提交回复
热议问题