Web development problems and experiences

Source: Internet
Author: User
  1. Xml files are encoded in UTF-8 as much as possible. Some Words in gb2312 cannot be stored. For example, conversion is required even if they can be stored. UTF-8 is also in line with international standards.
  2. In CSS: hover, this pseudo class will expire if it is placed before: visited
  3. <A> If a tag does not have the href attribute, all pseudo classes for its css, such as hover, are invalid.
  4. Document. wirte ("<script language = 'javascript 'src = '" + file + "'> </" + "script>" format reference, the relative file path is the html path that references the js.

    For example, a.htm references x \ B. js, B. js references x \ c. js, the file should be x \ c. js instead of B. js direct path c. js, but the @ import and url () References in css do not have this problem.

  5. On the page, when the width of talbe is set to 100%, a blank scroll bar is left on the right. Set <body style = "overflow: auto">
  6. Do not use img labels for commonly used images. Use <span> <a> css to specify the background and width and height. For dynamic images (move up and change the background ), it is best to use <a> without writing additional code, as long as the pseudo class: hover is used. The advantage of using css is to change all changes at a time, this can be 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 found locally. Call <span style = "font-family: comic; font-size: 18pt> aa </span>
  8. Several CSS
    Div {overflow: hidden; text-overflow: ellipsis ;}
    Td {vertical-align: middle ;}
    To force overflow and applyEllipsisValue. The author must set the white-space attribute value of the objectNowrap.
    If there is no chance of line feed (for example, the width of the object container is narrow, and there is a long text without reasonable line breaks), there is no applicationNowrapIt may also overflow.
    To enableEllipsisValue is applied. This attribute must be set to an object with an invisible area. The best choice is to set the overflow attributeHidden
  9. Firefox's document. createElement does not support HTML tags or innerText, but innerHTML. You can use innerHTML to specify the content.
  10. In the. net control, the width of DropDownList in firefox is not colored. You need to directly define style = 'width: 10px ;'
  11. The css cursor in firefox does not support hand, instead of pointer.
  12. The scroll bar in iframe needs to set style = 'overflow: Den den 'in the iframe label. It cannot be set tightly in the body.
  13. When you use the onpropertychange event, you must use event. propertyName to filter attribute change events. When setting this event, the onpropertychange attribute has been changed and will be automatically executed once.
  14. Earlier versions of XSL in js5.6 are supported, which is not supported by document functions.
  15. Slice functions are slower than getting array fragments through direct loops.
  16. When nextSibling gets the next object, note that there should be no spaces between the two nodes. Otherwise, it is easy to get the correct object. You will get an object whose nodeName is # text.
  17. When CreateTextFile has Chinese characters, you must specify the third parameter as true. Otherwise, the file cannot be written to Chinese characters, resulting in an error when writing.
  18. When saving Chinese text, ADODB. stream is used, and fso is not used, because FSO does not support UTF-8 format
  19. In IE, execScript should be used instead of eval, because sometimes eval will be invalid.
  20. The character string ends with a newline character.
  21. Set control attributes in JS. For example, to convert style.css Text attributes, to convert class to className attributes.
  22. It is normal to run a script test, but it is not normal to copy it to the IDE for storage (an error is returned for some reason). You may need to check the script file and ASP, ASPX file encoding consistency (GB2312, UTF-8), you can use NotePad to save as consistent encoding or you can also specify its encoding when calling the script, such: <script language = "javascript" src = ". js "charset =" gb2312 "> </script>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.