Problems and experiences encountered in web development

Problems and experiences encountered in web development
<br />The following are the problems I encountered during development and the experiences I gained. It took me some time to debug, and I post them here to help others avoid detours.
1. XML files should be encoded in UTF-8 as much as possible. Some characters in GB2312 cannot be stored, such as ?. Even if they can be stored, they need to be converted, which is troublesome. UTF-8 also complies with international standards.
2. In CSS, the :hover pseudo-class will become invalid if placed before :visited.
3. If the <a> tag does not have an href attribute, all CSS pseudo-classes for it, such as :hover, will be invalid.

4. In the js file, the reference is in the form of document.wirte("<script language='javascript' src='" file "'></" "script>", and the file relative path is the path of the HTML that references the js.
For example: a.htm references x\b.js, b.js references x\c.js, then the file should be x\c.js instead of the direct path c.js relative to b.js. However, this problem does not exist in the @import and url() references in CSS. 5. In the page, sometimes the width of the talbe is set to 100%, which will leave a blank space on the right side of the scroll bar. Please set <body style="overflow:auto">
6. For commonly used images, do not use the img tag. Use <span><a> and use CSS to specify its background and width and height. For dynamic ones (changing the background when moving), it is best to use <a>. No additional code is required. Just use the pseudo-class :hover. The advantage of using CSS is that all changes can be made at once, which can be well used in skin-changing applications.
7. @font-face {font-family:comic;src:url(http://valid_url/some_font_file.eot);}
Define a font name that is not available locally and call <span style="font-family:comic;font-size:18pt>aa</span>
8. Some CSS
div { overflow: hidden; text-overflow: ellipsis; }
td { vertical-align : middle; }
To force overflow to occur and the ellipsis value to be applied, the author must set the object's white-space property to nowrap.
If there is no opportunity for line breaking (for example, the width of the object container is narrow, and there is a long text without reasonable line breaks), overflow is possible even without applying nowrap.
In order for the ellipsis value to be applied, this property must be set to an object that has an invisible area. The best option is to set the overflow property to hidden.
9. Firefox's document.createElement does not support HTML tags in the content, nor does it support innerText, but it supports innerHTML, and you can use innerHTML to specify its content.
10. The width of DropDownList in .net control is not colored in Firefox, you need to directly define style='width:10px;'
11. The CSS cursor in Firefox does not support hand, use pointer instead.

12. The scroll bar in the iframe needs to be set with style='overflow:hidden' in the iframe tag. It cannot be set only in the body, otherwise there will be problems in Firefox.
13. In the onpropertychange event, pay attention to using event.propertyName to filter the property change event. When setting this event, the onpropertychange property has actually been changed, so it will be automatically executed once.
14. The version of XSL supported in js5.6 is relatively low, such as the document function is not supported.

15. The slice function is slower than directly looping to get array fragments.
16. When nextSibling obtains the next object, it is important to note that there should be no space between the two nodes, otherwise it is easy to fail to obtain the correct object.
17. When there is Chinese in CreateTextFile, the third parameter must be specified as true, otherwise Chinese cannot be written, which will result in an error when Write is called.
18. Use ADODB.stream when saving Chinese text, not fso, because FSO does not support utf-8 format.

<<:  MySQL query method with multiple conditions

>>:  WeChat Mini Programs Implement Star Rating

Recommend

mysql row column conversion sample code

1. Demand We have three tables. We need to classi...

Windows cannot start MySQL service and reports error 1067 solution

Suddenly when I logged into MySQL, it said that a...

CSS3 to achieve floating cloud animation

Operation effect html <head> <meta chars...

W3C Tutorial (8): W3C XML Schema Activities

XML Schema is an XML-based alternative to DTD. XM...

HTML+CSS to create heartbeat special effects

Today we are going to create a simple heartbeat e...

Detailed explanation of Nginx timed log cutting

Preface By default, Nginx logs are written to a f...

MySQL 5.6 installation steps with pictures and text

MySQL is an open source small relational database...

Docker sets up port mapping, but cannot access the solution

#docker ps check, all ports are mapped CONTAINER ...

Learn the basics of JavaScript DOM operations in one article

DOM Concepts DOM: document object model: The docu...

Native js to achieve simple carousel effect

This article shares the specific code of js to ac...

In-depth discussion on auto-increment primary keys in MySQL

Table of contents Features Preservation strategy ...

How to create an index on a join table in MySQL

This article introduces how to create an index on...

How to create a basic image of the Python runtime environment using Docker

1. Preparation 1.1 Download the Python installati...

How to use negative margin technology to achieve average layout in CSS

We usually use float layout to solve the compatib...