NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: peterH on October 27, 2015, 10:52:25 AM

Title: How to open a new browser window from code
Post by: peterH on October 27, 2015, 10:52:25 AM
A report procedure opens a new page (programatically) when done. Depending on whether the report was generated or not there's a choice of two different pages. If the report was generated I display it to the user and for this I'm using this code which works fine:

Quote
p_web.script('location.href="servedocument?docid=' & DOC:doc_id & '"')

The problem is that the browser just opens the new page but I want it to display the page in a new window (browser tab). Since location.href doesn't take a target parameter I'm lost here. Is there another way to accomplish what I want?

Peter
Title: Re: How to open a new browser window from code
Post by: Stu on October 28, 2015, 08:48:42 PM
Hi Peter,

So .. you have your main tab, a tab for the report (pdf?), and you want a third tab to be automatically created and sent to a url?

Would it be possible to give a little context as to the reasons why you want the new tab to be opened, that might help us a little.
Title: Re: How to open a new browser window from code
Post by: Bruce on October 28, 2015, 11:31:27 PM
http://stackoverflow.com/questions/8944697/how-to-use-target-in-location-href