Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 834
  • Last Modified:

window.location ------ how to display a file in a new window ?

Hello,
For the following html, the myfile.pdf will be displayed in the same window.

<tr> <td  onmouseover="className='over'" onmouseout="className='out'" onclick="window.location=myfile.pdf'"><div align="center"><strong>Display in a new window</strong></div></td></tr>

<tr>..... </tr>


Is that possible that to display myfile.pdf in a new window?

Thanks for your reply,
Regards,
lilyyan
0
lilyyan
Asked:
lilyyan
2 Solutions
 
R7AFCommented:
You don't need javascript to do this. This can be done using plain HTML. See
http://www.htmlcodetutorial.com/linking/_A_TARGET.html

<a href="myfile.pdf" target="_blank">Display in a new window</a>
0
 
Martin CotterillDabblerCommented:
If you want to use Javascript to have more control over how the window looks, try onclick="window.open('myfile.pdf','newWin')".

You can then add various switches to allow/disallow such interesting this as address bar, menu bar etc..

Regards
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now