Opening a text file in browser - error on server

Posted by Lehan Coetzee on Stack Overflow See other posts from Stack Overflow or by Lehan Coetzee
Published on 2012-08-29T09:34:25Z Indexed on 2012/08/29 9:38 UTC
Read the original article Hit count: 359

Filed under:
|
|

I'm trying to open a text file in my browser, when doing it from my local machine it works perfectly but when I upload my files to my web server the link to the text file no longer works and I get a broken link error from the browser.

Here is my code for opening the txt file:

<div style="width: 100%; background-color: #CCC;text-align: center;">
<a href="code.txt" onclick="window.open(this.href,this.target,'height=300, width=500');return false;">Code</a>
</div>

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript