国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Web Front-end CSS Tutorial BUG problem of href under IE_Experience exchange

BUG problem of href under IE_Experience exchange

May 16, 2016 pm 12:04 PM
bug href ie

Copy Code The code is as follows:

As a result, it will pop up for the second time in IE6 and IE7 browsers The href value of the A element in result.innerHTML becomes an absolute path.
In fact, our ancestors have encountered these problems long ago (thanks to Uncle Yu for the information):
  • 《getAttribute(”HREF”) is always absolute》
  • 《getAttribute href bug》
    The solution has been mentioned in the above article, which is to use the getAttribute('href', 2) method under IE. Microsoft has extended this method with a second parameter that can be set to 0, 1, or 2. If set to 2, the original value of the property is returned.
    The script is corrected to:
    Copy code The code is as follows:

    (function() {
    var test = document.getElementById('test');
    alert(test.innerHTML);
    var result = document.getElementById('result');
    result.innerHTML = test. innerHTML;
    if(/*@cc_on!@*/0 ) { //if ie
    var links1 = test.getElementsByTagName('a');
    var links2 = result.getElementsByTagName('a' );
    for(var i = 0, len = links1.length; i links2[i].href = links1[i].getAttribute('href', 2); }
    }
    alert(result.innerHTML);
    })();

    While searching for this problem, I also searched for one discovered by Hedger Wang Interesting BUG: When resetting a new href attribute value in IE, if the link text contains "http://" or "@", its innerHTML will be displayed incorrectly and will display as the set href attribute.
    Solution (sHref is the new value of href to be set):
    Copy code The code is as follows:

    s;
    var isMSIE = /*@cc_on!@*/false;
    if( isMSIE ){
    sHref = ' ' sHref; //add extra space before the new href
    };

    詳細(xì):《Internet Explorer might reset Anchor's innerHTML incorrectly when a new “href” is assigned》

  • Statement of this Website
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

    Hot AI Tools

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    Notepad++7.3.1

    Notepad++7.3.1

    Easy-to-use and free code editor

    SublimeText3 Chinese version

    SublimeText3 Chinese version

    Chinese version, very easy to use

    Zend Studio 13.0.1

    Zend Studio 13.0.1

    Powerful PHP integrated development environment

    Dreamweaver CS6

    Dreamweaver CS6

    Visual web development tools

    SublimeText3 Mac version

    SublimeText3 Mac version

    God-level code editing software (SublimeText3)

    What do src and href mean? What do src and href mean? Aug 16, 2023 pm 05:00 PM

    src and href are respectively, 1. src is the abbreviation of source, which is used to specify the path of external resources. It is usually used to embed external files, such as pictures, audios, videos, etc. The src attribute is generally used on img, script, iframe and other tags. ; 2. href is the abbreviation of hypertext reference, which is used to specify the path of the target resource of the hyperlink. It is usually used to link to external documents or other pages. The href attribute is generally used on tags such as a and link.

    What does game bug mean? What does game bug mean? Feb 18, 2024 am 11:30 AM

    What do game bugs mean? During the process of playing games, we often encounter some unexpected errors or problems, such as characters getting stuck, tasks being unable to continue, screen flickering, etc. These abnormal phenomena are called game bugs, that is, faults or errors in the game. In this article, we'll explore what game bugs mean and the impact they have on players and developers. Game bugs refer to errors that occur during the development or operation of the game, causing the game to fail to run normally or to behave unexpectedly. These errors may be due to

    Apple iOS18 bug summary Apple iOS18 bug summary Jun 14, 2024 pm 01:48 PM

    As Apple's WWDC conference 2024 came to a successful conclusion, not only macos15 was announced, but the update of Apple's new iOS18 system attracted the most attention. Although there are many new features, as the first version of Apple's iOS18, people inevitably wonder whether it is necessary to upgrade Apple. iOS18, what kind of bugs are there in the latest release of Apple iOS18? After real use evaluation, the following is a summary of Apple iOS18 bugs, let’s take a look. Currently, many iPhone users are rushing to upgrade to iOS18. However, various system bugs are making people uncomfortable. Some bloggers said that you should be cautious when upgrading to iOS18 because "there are so many bugs." The blogger said that if your iPhone is

    Internet Explorer opens Edge: How to stop MS Edge redirection Internet Explorer opens Edge: How to stop MS Edge redirection Apr 14, 2023 pm 06:13 PM

    It's no secret that Internet Explorer has fallen out of favor for a long time, but with the arrival of Windows 11, reality sets in. Rather than sometimes replacing IE in the future, Edge is now the default browser in Microsoft's latest operating system. For now, you can still enable Internet Explorer in Windows 11. However, IE11 (the latest version) already has an official retirement date, which is June 15, 2022, and the clock is ticking. With this in mind, you may have noticed that Internet Explorer sometimes opens Edge, and you may not like it. So why is this happening? exist

    What does system bagage mean? What does system bagage mean? Nov 09, 2022 pm 02:40 PM

    System bagage refers to system bug; the original meaning of bug is "bug", and now it can be used to refer to vulnerabilities that exist on the computer. The reason is that there are flaws in the system security policy, and there is a danger that attackers can access without authorization; in a broad sense On the topic, bug can be used to describe loopholes or defects that appear in various fields.

    What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) What should I do if win11 cannot use ie11 browser? (win11 cannot use IE browser) Feb 10, 2024 am 10:30 AM

    More and more users are starting to upgrade the win11 system. Since each user has different usage habits, many users are still using the ie11 browser. So what should I do if the win11 system cannot use the ie browser? Does windows11 still support ie11? Let’s take a look at the solution. Solution to the problem that win11 cannot use the ie11 browser 1. First, right-click the start menu and select "Command Prompt (Administrator)" to open it. 2. After opening, directly enter "Netshwinsockreset" and press Enter to confirm. 3. After confirmation, enter "netshadvfirewallreset&rdqu

    The end of an era: Internet Explorer 11 is retired, here's what you need to know The end of an era: Internet Explorer 11 is retired, here's what you need to know Apr 20, 2023 pm 06:52 PM

    June 15, 2022 is the day when Microsoft ends support for Internet Explorer 11 (IE11) and closes its legacy browser chapter. The company has been reminding users of this end-of-life date for some time and calling on them to plan a move to Microsoft Edge. Microsoft bundles IE11 with Windows 8.1 as the modern default web browser for Windows. Although it never reached the (current) heights of Chrome, it was the second most used desktop browser in 2014, behind IE8. Of course, with 20

    Sorting out Win11 errors and issues Sorting out Win11 errors and issues Jan 13, 2024 pm 08:21 PM

    Some people want to update win11, but they don’t know if there are many bugs in win11 and whether the update will cause problems. In fact, there are bugs in win11 now, but they have little impact on use. Are there many bugs in win11? Answer: There are still many bugs in win11. However, these bugs have little impact on daily use. If the user has high requirements for daily use, it is recommended to use it later. Summary of win11 bugs 1. Resource Manager 1. Sometimes memory overflow occurs, resulting in high memory usage of the Resource Manager. 2. This situation will cause the memory to occupy more than 70%, causing the computer to freeze or even crash. 2. Conflict and crash 1. Some applications are not compatible enough, causing conflicts with each other. 2. Although there are relatively few conflict procedures,

    See all articles