How to add target=“_blank” to JavaScript [removed]?

后端 未结 4 789
渐次进展
渐次进展 2020-11-28 03:05

The following sets the target to _blank:

if (key == \"smk\") {
    window.location = \"http://www.smkproduction.eu5.org\";
    target = \"_blank         


        
4条回答
  •  情话喂你
    2020-11-28 03:31

    I have created a function that allows me to obtain this feature:

    function redirect_blank(url) {
      var a = document.createElement('a');
      a.target="_blank";
      a.href=url;
      a.click();
    }
    

提交回复
热议问题