E V N Raja
E V N Raja

Reputation: 110

How to show file content into a HTML to make it as complete HTML

I was planning to construct an HTML file which takes the input from another file.

Example

I want write an HTML file as follows:

<html>
.
.
//file content
.
</html>

File as follows:

<td> </td>
.
.

Is there a simple way to do this?

Upvotes: 0

Views: 48

Answers (1)

Facundo Larrosa
Facundo Larrosa

Reputation: 3389

You can do it using the jQuery .load() function, but it is better to use another container rather than the HTML element tag. A div for example:

<div id="container">

</div>

And your JavaScript code using jQuery:

$('#container').load('path/to/your/file.html');

Upvotes: 1

Related Questions