As the name says; I want the contents of an external file (text, html, php, etc.) on a div. There is text text in the external file: text_1.txt or * text_1.html *, and I want this text to appear in the div that is on the main page.
An ideal solution would be a fairly simple code to display text from a text or html file by inserting it into the div: content class
Here I illustrated the problem with the underlying code, use this as an example to write a solution.
Code in text_1.html:
<p>Hello world.</p>
Code in index.html:
<!doctype html> <html> <head> <title>Homepage</title> </head> <body> <div class="content"></div> </body> </html>
It is as simple as I can put it. I appreciate all the answers I get, thanks.
PS here are some things you should avoid answering:
- Use iframes or any other frame type solution.
- Use onclick function in jQuery etc.
- Use ineffective text fields to replace specific text.
- Use embed code for a virtual server or similar methods.
source share