Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/457.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仅打开url,不单击-单击必须手动完成_Javascript_Window.open - Fatal编程技术网

Javascript Window.open仅打开url,不单击-单击必须手动完成

Javascript Window.open仅打开url,不单击-单击必须手动完成,javascript,window.open,Javascript,Window.open,我正在使用window.open并单击,它会打开一个新窗口,预先填充地址栏,但不会打开地址栏中填充的url(对于chrome) 是否有我做错了什么。您缺少协议(在您的示例中为http或https) 对于浏览器来说,重要的是要知道您传递的是绝对uri还是相对uri。如果它是绝对的(就像在你的例子中),你必须预先编写协议。你缺少协议(在你的例子中是http或https) 对于浏览器来说,重要的是要知道您传递的是绝对uri还是相对uri。如果它是绝对的(如您的情况),则必须预先编写协议。没有http[

我正在使用window.open并单击,它会打开一个新窗口,预先填充地址栏,但不会打开地址栏中填充的url(对于chrome)


是否有我做错了什么。

您缺少协议(在您的示例中为
http
https


对于浏览器来说,重要的是要知道您传递的是绝对uri还是相对uri。如果它是绝对的(就像在你的例子中),你必须预先编写协议。

你缺少协议(在你的例子中是
http
https


对于浏览器来说,重要的是要知道您传递的是绝对uri还是相对uri。如果它是绝对的(如您的情况),则必须预先编写协议。

没有
http
[Exception…”URI格式错误“nsresult:”0x804b000a(NS_ERROR\u malformed_URI)“location:”在Firefox中:“JS frame::debugger eval code:::line 1”数据:否。没有
http
[Exception…”URI格式错误“nsresult:“0x804b000a(NS_错误_格式错误_URI)”位置:“JS框架::调试器评估代码:::Firefox中的第1行“数据:否”。
window.open("www.stackoverflow.com","_blank")
window.open("https://www.stackoverflow.com","_blank")