Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/463.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 Phoenix Js和音频文件添加_Javascript_Audio_Elixir_Phoenix Framework - Fatal编程技术网

Javascript Phoenix Js和音频文件添加

Javascript Phoenix Js和音频文件添加,javascript,audio,elixir,phoenix-framework,Javascript,Audio,Elixir,Phoenix Framework,我是长生不老药研发新手。我有几个声音和js文件,我把它们添加到我的资产文件夹中。当我试图访问它们时,出现了一个错误 GET http://127.0.0.1:4000/js/calls.js 404 (Not Found) call:1 GET http://127.0.0.1:4000/sounds/ringtone.wav call:1 GET http://127.0.0.1:4000/sounds/ringbacktone.wav 404 (Not Found) call:1 GET

我是长生不老药研发新手。我有几个声音和js文件,我把它们添加到我的资产文件夹中。当我试图访问它们时,出现了一个错误

GET http://127.0.0.1:4000/js/calls.js 404 (Not Found)
call:1 GET http://127.0.0.1:4000/sounds/ringtone.wav 
call:1 GET http://127.0.0.1:4000/sounds/ringbacktone.wav 404 (Not Found)
call:1 GET http://127.0.0.1:4000/assets/sounds/dtmf.wav 404 (Not Found)
call:1 GET http://127.0.0.1:4000/assets/sounds/ringtone.wav 404 (Not Found)
call:1 GET http://127.0.0.1:4000/assets/sounds/ringbacktone.wav 404 (Not Found)
call:1 GET http://127.0.0.1:4000/sounds/dtmf.wav 404 (Not Found) 
但是声音文件已经在assets文件夹中,conn.js也在js文件夹中。这是如何将call.js连接到html的示例代码

 <script src="<%= static_path(@conn, "/js/call.js") %>"></script>

在endpoint.ex文件中,我相信您需要添加声音文件夹

lib->AppName->endpoint.ex

  plug Plug.Static,
    at: "/", from: :heaped, gzip: false,
    only: ~w(css fonts images sounds js favicon.ico robots.txt)

If sounds是文件夹的名称。:-)

谢谢你的回复,我已经补充了。问题是它再次显示自定义js文件的错误。
  plug Plug.Static,
    at: "/", from: :heaped, gzip: false,
    only: ~w(css fonts images sounds js favicon.ico robots.txt)