Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/473.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 在同一选项卡中打开新html会导致问题_Javascript_Html - Fatal编程技术网

Javascript 在同一选项卡中打开新html会导致问题

Javascript 在同一选项卡中打开新html会导致问题,javascript,html,Javascript,Html,我想在同一个选项卡中打开新的html,所以我添加了“\u self”,但由于我使用它,该功能响应不太好,它无法加载所有内容,基本上它会导致我的程序无法正常工作,因为它没有“\u self” p、 s.-I使用window.opener.var,所以这可能是原因 我能帮你修一下吗 window.open('category.html',"_self"); 您需要使用以下选项: window.location.href = "category.html"; 您正在使用一个window.ope

我想在同一个选项卡中打开新的html,所以我添加了
“\u self”
,但由于我使用它,该功能响应不太好,它无法加载所有内容,基本上它会导致我的程序无法正常工作,因为它没有
“\u self”

p、 s.-I使用window.opener.var,所以这可能是原因

我能帮你修一下吗

window.open('category.html',"_self");
您需要使用以下选项:

  window.location.href = "category.html";
您正在使用一个
window.open()
方法在新选项卡中打开页面。 使用
window.location.href
可以在同一选项卡中更改url。

您需要使用以下选项:

  window.location.href = "category.html";
您正在使用一个
window.open()
方法在新选项卡中打开页面。
使用
window.location.href
可以在同一选项卡中更改url。

我可以在使用方法窗口加载的新页面中使用。opener?我看到现在我定义为window.var的var对新页面并不熟悉。我可以在使用方法窗口加载的新页面中使用。opener?我看到现在我定义为window.var对新页面不熟悉。。