Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/471.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 window.open找不到html文件_Javascript_Flask - Fatal编程技术网

Javascript window.open找不到html文件

Javascript window.open找不到html文件,javascript,flask,Javascript,Flask,我在file1.html中有这部分ajax代码: success: function (response) { respObj = JSON.parse(response); console.log(respObj["data"]); var myWindow = window.open('find_patient.html', 'pop

我在file1.html中有这部分ajax代码:

    success: function (response) {
                      respObj = JSON.parse(response);
                      console.log(respObj["data"]);
                      var myWindow = window.open('find_patient.html', 'popup', "width=400,height=100");
                      },
              error: function (error) {
                  console.log(error);
              },
          });

我希望看到新窗口打开,但是我发现它找不到文件,当然它在同一个目录中。现在,我的后端是flask,我看到它试图打开“http://localhost:5000/find_patient.html“在新窗口。关于如何在同一目录下打开文件,如root\u dir/templates/find\u patient.html,有什么建议吗?如果没有,您需要提供一个有意义的路径,比如
/templates/find_patient.html
。奇怪的是,您将一个原始html文件转储到一个弹出窗口中,这本身就是一个需要尝试和避免的反模式。通常你会访问一个烧瓶端点。实际上,我用它弹出一个表,用于从一行中选择数据。有什么建议我应该如何处理其他问题吗?不清楚这意味着什么。只是静态数据吗?它是否有JavaScript在父窗口中执行某些操作?您是否在Web服务器或本地文件系统上进行测试?