小编mrH*_*rse的帖子

使用jquery的CORS错误

我目前正在使用cloudapp API开发一个项目,我正在使用jquery.这是我的代码:

 $.ajax({
            headers: { "Accept": "application/json"},
            type: 'GET',
            url: 'http://cl.ly/2wr4',
            crossDomain: true,
            success: function(data, textStatus, request){
                console.log(data);
            }
 });
Run Code Online (Sandbox Code Playgroud)

当我运行这个时,我得到200 OK响应并在Firefox中出现此错误:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://cl.ly/2wr4. This can be fixed by moving the resource to the same domain or enabling CORS.
Run Code Online (Sandbox Code Playgroud)

以及Google Chrome中的此错误:

XMLHttpRequest cannot load http://cl.ly/2wr4. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
Run Code Online (Sandbox Code Playgroud)

并且没有任何内容记录到控制台.请问我该如何解决这个错误?

谢谢.

javascript ajax jquery cors

5
推荐指数
3
解决办法
4万
查看次数

Soundcloud波形

我想知道soundcloud如何生成他们的波形.

  1. 这是在服务器端完成的吗?是使用网络音频API完成的吗?
  2. 如何使用Web音频API实现像soundcloud这样的静态波形?

谢谢

javascript waveform soundcloud web-audio-api

1
推荐指数
1
解决办法
1467
查看次数

标签 统计

javascript ×2

ajax ×1

cors ×1

jquery ×1

soundcloud ×1

waveform ×1

web-audio-api ×1