In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
How to understand the differences and relations between .html and .htm and .shtml and .shtm in HTML development. In view of this problem, this article introduces the corresponding analysis and solutions in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
As we all know, the web page or website or web page we visit every day has its own suffix name, and different suffix names correspond to different file formats and different rules, protocols, and usages. The most common suffix names are .html and .htm, as well as the common .shtml and .shtm formats. Most of us developers only know that they are not much different and can be used at will, but they do not realize that there is some connection.
First of all, introduce .html and .htm
Html is one of the most basic and widely used saving format of web page files nowadays. It is a hypertext markup language and a description language of WWW. Different from the text format saved by dynamic web page technologies such as PHP, jsp, asp and so on, the page does not have any statements to be executed on the server side. It is a static page format that can be directly interpreted and displayed by ordinary browsers.
With regard to htm, in fact, there is no essential difference from html, just to meet DOS's 8x3 (file name can not exceed 8 characters, extension can not exceed 3 characters) file name specification. Because some older systems (32-bit) do not recognize 4-bit file extensions, some servers require the last l of .html to be omitted. Browsers can automatically recognize and open these files, but when writing these web addresses, they must be corresponding, that is, index.html and index.htm are two different files with different addresses.
Secondly, introduce .shtml and .shtm
With regard to shtml, it is a file supported by SSI technology, that is, the included instruction of the Server Side Include--SSI server segment. Some Web Server will entertain the shtml file specially if it has SSI function. The server will first scan the shtml file to see if there is a special SSI instruction, and if so, interpret the SSI instruction according to the setting rules of Web Server. Then after the explanation, it will be interpreted and displayed by the browser along with the ordinary HTML.
The relationship between shtm,shtm and shtml is similar to that between htm and html.
Finally, the relationship between html or htm and shtml or shtm
Html or htm is a static page format, that is to say, there is no need for the server to parse the script, or there is no script executed on the server side, while shtml or shtm is based on SSI technology, when the server-side execution of scripts is treated as a dynamic language, just like PHP, JSP or ASP.
When shtml or shtm does not contain server-side executable scripts, it works the same as html or htm.
The difference between SHTML and HTML can be explained in one sentence: SHTML is not a HTML but a server API,shtml is a dynamic html generated by the server.
Although both are in hypertext format, shtml is a file for SSI technology. That is, the Server Side Include--SSI server contains instructions. If Web Server has SSI capabilities (most WEB servers (especially based on Unix platforms), such as Netscape Enterprise Server, support the SSI command).
There will be a special treat for shtml files. Scan the shtml file first to see if there are no special SSI instructions now.
Interpret the SSI instruction according to the Web Server setting rules. After the explanation, drop it to the client together with the general html.
Shtml
Using the html file extension of SSI (Server Side Include), SSI (Server Side Include), commonly referred to as "server-side embedding" or "server-side inclusion", is a server-based web page creation technology similar to ASP.
How SSI works:
Before sending content to a browser, you can use the server-side SSI directive to include text, graphics, or application information in a web page. For example, you can use SSI to include a time / date stamp, a copyright notice, or a form for customers to fill out and return. Using an include file is an easy way for text or graphics that are repeated in multiple files. You can save the content in one include file without having to enter the content into all files. The include file can be invoked with a very simple statement that instructs the Web server to insert the content into the appropriate web page. Moreover, when using an include file, all changes to the content can be done in one place.
Because files that contain SSI directives require special handling, all SSI files must be given a SSI file extension. The default extensions are .stm, .shtm, and .shtml
The Web server processes SSI instructions while processing web pages. When the Web server encounters the SSI instruction, it inserts the contents of the containing file directly into the HTML web page. If the include file contains a SSI directive, the file is also inserted. In addition to the basic instructions for including files, you can use the SSI directive to insert information about the file (such as the size of the file) or run an application or shell command.
One of the problems often encountered in website maintenance is that the structure of the website is fixed, but a large number of pages have to be redone in order to update a little content. SSI provides a simple and effective way to solve this problem. It puts the basic structure of a website into several simple HTML files (templates). In the future, all we have to do is to transfer the text to the server and let the program automatically generate web pages according to the template, thus making it easy to manage large websites.
Therefore, the purpose of pages using SHTML format is similar to that of ASP, but because it is API, it is faster and more efficient, faster than ASP and slower than HTML, but because server-side inclusion can be used, it makes page updates easy (especially batch update banner) Copyright, etc.), imagine that you have a HTML, and you have to insert some special server scripts in the middle, such as inserting other HTML paragraphs, and you choose ASP to complete this task, but if the task is more onerous, it takes more time, such as 5s, at this time you use SHTML instead of ASP, maybe the processing time is only 4 seconds.
This is the answer to the question about how to understand the difference and connection between .html and .htm and .shtm and .shtm in HTML development. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.