How do I use Target=_blank on a response.redirect?

后端 未结 12 1921
梦谈多话
梦谈多话 2020-12-10 16:12

I do not necessarily have to use response.redirect, but that is what I had. I would like to open the selected link in a new window. How do I do that?

context         


        
12条回答
  •  [愿得一人]
    2020-12-10 16:40

    You can't is the short answer. The browser is the only thing that can open up a new window.

    What you can do is send a chunk of html down the response that has a link with your url as an href, target="_blank" and a chunk of javascript onload of the form that fakes a click. If this doesn't work then use a window.open(url);

    response.write(""); 
    

提交回复
热议问题