HTML Template File

前端 未结 6 648
梦毁少年i
梦毁少年i 2021-01-28 04:29

I know this is a beginner\'s question, but I\'ve been searching online and all I can find are \"free website templates\" that I can download.

The question is: How can I

6条回答
  •  盖世英雄少女心
    2021-01-28 05:09

    There are a few ways you can do this, but first of all we must establish what hosting environment you'll be running your site on. It's also completely dependant on what you're trying to achieve - are you programming, or just simply including a HTML page in another HTML page?

    If your web-host allows you to run back-end code like Classic ASP, ASP.NET, PHP, MVC, Ruby or Perl, then each one has one or more methods to include files.

    It's possible (though I haven't used this for a long, long time) that you can use an SSI directive within your HTML file. This is usually web-server dependant, rather than language dependant, and you can read more about it here. It's the easiest way to include files, but it has a lot of limitations.

    Alternatively, you could use AJAX to retrieve a page from your server and update the HTML in your page dynamically. Remember though, that this relies on the user having JavaScript enabled, and requires a bit more effort on your side.

提交回复
热议问题