Skip to content Skip to sidebar Skip to footer

Getting Local Html Inside Another Local Html With Javascript

I have got one html file in my PC that I use for work and I want to load another local html file to it, I want it to be loaded inside one div.

Solution 1:

Best and easiest way to use iframe:

<iframe id="loadHere" src="001.html"></iframe>

Solution 2:

At chromium / chrome browsers , try adjusting launcher to

chromium

/path/to/chromium-browser --allow-access-from-files

chrome

/path/to/google-chrome --allow-file-access-from-files

See

How do I make the Google Chrome flag “--allow-file-access-from-files” permanent?

List of Chromium Command Line Switches

Solution 3:

Easiest workaround that works with any browser - just load it in an iframe instead of a div:

<iframe id="loadHere" src="loadHere.html"></iframe>

OR set src with JS:

document.getElementById('loadHere').src = "something.html";

Post a Comment for "Getting Local Html Inside Another Local Html With Javascript"