Include another HTML file in a HTML file, Include another HTML file in a HTML file |
Include another HTML file in a HTML file, Include another HTML file in a HTML file |
Alan7799 |
Dec 19 2022, 09:33 AM
Post
#1
|
Group: Members Posts: 2 Joined: 19-December 22 Member No.: 28,703 |
Hi,
I am trying to include another HTML file in a HTML file using JavaScript. I have tried many solutions given on the web and have not found one that works. I am a beginner with HTML and JavaScript, so I need all the details. Thank for any help Alan |
Christian J |
Dec 19 2022, 02:36 PM
Post
#2
|
. Group: WDG Moderators Posts: 9,722 Joined: 10-August 06 Member No.: 7 |
This one should work: http://www.dynamicdrive.com/dynamicindex17/ajaxincludes.htm --at least if you test it from a web server. None of my newer browsers allow this script on HTML files that I open directly from my local file system. For security reasons, the included file must be hosted by the same domain as the page displaying it ("Same Origin Policy"), but browsers don't understand that the local file system is the same "domain" for both the parent page and the inclusion file. If you check the browser's javascript console there may be an error message about this.
|
Alan7799 |
Dec 19 2022, 03:42 PM
Post
#3
|
Group: Members Posts: 2 Joined: 19-December 22 Member No.: 28,703 |
Thank you for your replay.
I am trying to open the HTML file from my local file system. Thank you for the explanation why that will not work. Alan |
Lo-Fi Version | Time is now: 10th October 2024 - 08:40 AM |