How to redirect in “NEW” tab with meta

时光毁灭记忆、已成空白 提交于 2021-02-08 10:00:16

问题


Ho can we redirect a page in new tab when we use meta tag. For ex. i am trying this code

<meta http-equiv="refresh" content="5;URL=http://www.example.com >

but it redirects it in same page. And if i add the following code after the url then also nothing happens

target = "_blank"

Please help me.


回答1:


You can try something like this:

<meta http-equiv="refresh" content="5; URL=javascript:window.open('http://google.com','_blank');">

This post is related to your question.




回答2:


When I try this I receive an error in the console :

Refused to refresh https://example.com/ to a javascript: URL



来源:https://stackoverflow.com/questions/30025594/how-to-redirect-in-new-tab-with-meta

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!