The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Include another HTML file in a HTML file, Include another HTML file in a HTML file
Alan7799
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Alan7799
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 10th October 2024 - 08:40 AM