This worked for me fine:
File 1: <html> <head></head> <body> <a href="#" onclick="window.open('file:///D:/Examples/file2.html'); return false">CLICK ME</a> </body> <footer></footer> </html>
File 2: <html> ... </html>
This method works regardless of whether or not the 2 files are in the same directory, BUT both files must be local.
For obvious security reasons, if File 1 is located on a remote server you absolutely cannot open a file on some client’s host computer and trying to do so will open a blank target.
Improve this answerFollow
180k2929 gold badges183183 silver badges244244 bronze badges
answered May 15, 2014 at 6:19