• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to show response in new window

 
swapnel surade
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

I want to show the response in new browser window after clicking on the button or link.
Please tell me the way to achieve this functionality.

thanks
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to use JavaScript to do this, some thing like

should do it.
 
Noble Bhaskar Aswanapally
Greenhorn
Posts: 13
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use target="_blank" HTML attribute

example:
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think that there is any server side code that could help you with this. You cannot open a new browser window for the response from the server.

You can however get the response in a new window at the client side. In case of links and forms it is a simple matter of adding target='_blank'. Just one points here,
1. target attribute is Deprecated - so its a bad practice to use it.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Noble Bhaskar Aswanapally wrote:use target="_blank" HTML attribute

example:


Though this will work it is not the best way to do it - it is not valid HTML.
 
Saifuddin Merchant
Ranch Hand
Posts: 607
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:


Though this will work it is not the best way to do it - it is not valid HTML.


Why not - its still an legal HTML attribute right (Deprecated does not mean illegal)? I agree it bad but so is window.open() - putting in JavaSciprt inside a anchor tag so that its valid XHTML seems equally bad.

I was trying to look for it but could not find the reason why the 'target' tag is depreciated - anyone has an idea?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The reason its not valid, rather than just deprecated, is its existance in an HTML page means the browser will swap to quirks mode.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul, the target attribute is alive and well according to the HTML 4 and 5 specifications. Where are you getting information regarding its invalidity?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not part of HTML4.01 strict as far as I am aware.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Sturrock wrote:Its not part of HTML4.01 strict as far as I am aware.


But contrasting to strict, we do have a loose.dtd. Right? So it can be valid there. Isnt it? Just a thought.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not appear to be in that DTD, but the HTML 4 spec says nothing about that (not that it's the best-written spec I've had to deal with).

Luckily, I do not believe that HTML 5 has any of the loose vs strict nonsense. But it's early. They still have plenty of time to over-complicate things.

I use target everywhere with no difficulties.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Luckily, I do not believe that HTML 5 has any of the loose vs strict nonsense. But it's early. They still have plenty of time to over-complicate things.

I use target everywhere with no difficulties.


Thats indeed a good & glad news
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic