Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/419.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript VM836 test.js:52未捕获(承诺中)语法错误:意外标记<;在JSON中的位置0。为什么?_Javascript_Json - Fatal编程技术网

Javascript VM836 test.js:52未捕获(承诺中)语法错误:意外标记<;在JSON中的位置0。为什么?

Javascript VM836 test.js:52未捕获(承诺中)语法错误:意外标记<;在JSON中的位置0。为什么?,javascript,json,Javascript,Json,我正在使用下面的代码,但是我得到了错误“位置0处的JSON中的意外标记

我正在使用下面的代码,但是我得到了错误“位置0处的JSON中的意外标记<”为什么我得到了它,我如何修复它

async function sendURL(urls) {
  const res = await fetch("/ffmpegserver/upload/urls", 
  { method: "POST", headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, 
  body: JSON.stringify({ urls: urls}) });
  const json = await res.json();
  return json;
}


window.onload = async () => {
  const result = await sendURL([
    "http://s5.qhres.com/static/465f1f953f1e6ff2.mp3",
    "https://file-examples-com.github.io/uploads/2017/11/file_example_MP3_700KB.mp3"
  ]);
  console.log(result);
}

我的钱说响应不是有效的json,可能是HTML(因此
这是否回答了您的问题?“SyntaxError:Unexpected tokentry/catch