IE6hackforjs highlights _ javascript tips-js tutorial

Source: Internet
Author: User
This article describes how to use js to implement Website Functions compatible with IE6. It is a very practical tips. If you need it, refer to the issue of iframe not displayed under ie6.

In ie6, iframe is not displayed. It can only be displayed after refreshing. This problem is not caused by slow page loading. There are several possible causes of this problem:

The src attribute is placed first in iframe (not met)
The height is set to 100%. iframe in ie6 cannot get the actual height value. Solution: Set it to a fixed height value.
This problem also occurs when the onclick event is triggered by TAG a to dynamically create an iframe. Solution: Add return false to the click function. For example:


2. Multiple loading of css sprite in ie6

In css sprite under ie6 and css using the background image, the same image is loaded multiple times, increasing the number of requests, and flashing occurs in images with hover effect. Solution:

 

3. page Jump failure

When js window. location. href = url is used in ie6 to perform page Jump, this will be invalid, especially when onclick is used in the tag to execute this function. Solution:

Window. location. href = url; return false;

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.