Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3357244
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:36:36+00:00 2026-05-18T02:36:36+00:00

I am trying to replicate, with my own code, the history-sniffing demo seen on

  • 0

I am trying to replicate, with my own code, the history-sniffing demo seen on http://wtikay.com/ and various other places. (It’s a long story.)

I have something that works reliably in most older browsers (latest Safari and Chrome releases and Firefox 4 betas have a defense) — but it doesn’t work in IE7 or 8 (haven’t tried 6), and I cannot figure out why. It seems to be that IE just isn’t bothering to update its rendering when I change the href property on an a element — but as far as I can tell, that’s exactly what wtikay does, and it works.

Test file:

<!doctype html>
<html><head>
<title>gevalt</title>
<style>
  body { background-color: gray }
  a:link { text-decoration: none; color: black }
  a:visited { color: white }
</style>
<body>
<span id="container"><a href="" id="testlink">test</a></span>
<a href="ftp://">minus</a>
<a href="http://www.google.com/">plus</a>
<script>
window.onload = function()
{
    var testlink = document.getElementById("testlink");
    var results = document.getElementById("results");
    var container = document.getElementById("container");
    var report = "";

    testlink.href = "ftp://";
    container.removeChild(testlink);
    container.appendChild(testlink);
    report += " -" + (testlink.currentStyle || window.getComputedStyle(testlink, "")).color;

    testlink.href = "http://www.google.com/";
    container.removeChild(testlink);
    container.appendChild(testlink);
    report += " +" + (testlink.currentStyle || window.getComputedStyle(testlink, "")).color;

    results.appendChild(document.createTextNode(report));
};
</script>
<pre id="results">
</pre>
</body></html>

In a browser where it works, the words “test” and “plus” will be white (assuming you have visited http://www.google.com in that browser), the word “minus” will be black, and it will print something like “-rgb(0,0,0) +rgb(255,255,255)” underneath. In IE, “test” will be black instead of white, and underneath it will read “-black +black“. Or possibly “test” will be white but underneath it will read “-white +white“. Both those are failures.

Any help would be most appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:36:37+00:00Added an answer on May 18, 2026 at 2:36 am

    For the record: to make this work in IE, you have to replace the <a> element with an entirely new one, every time you want it to notice a change in the href, and the new element must be added to the document.

    This is the case in 6, 7, and 8; I haven’t tried the v9 betas.

    window.onload = function()
    {
        var testlink;
        var results = document.getElementById("results");
        var container = document.getElementById("container");
        var report = "";
    
        testlink = document.createElement("a");    
        testlink.href = "ftp://";
        container.appendChild(testlink);
        report += " -" + (testlink.currentStyle || window.getComputedStyle(testlink, "")).color;
    
        container.removeChild(testlink);
        testlink = document.createElement("a");
        testlink.href = "http://www.google.com/";
        container.appendChild(testlink);
        report += " +" + (testlink.currentStyle || window.getComputedStyle(testlink, "")).color;
    
        results.appendChild(document.createTextNode(report));
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to replicate the functionality i've seen on a couple of sites: http://todaslistas.heroku.com
Im trying to replicate an effect as seen on http://www.fiat.co.uk/Showroom/#showroom/punto_evo/explore . I have made
I'm trying to replicate the browser post parameters on http://www.ebayclassifieds.com/m/PostAd?scrid=3465450-2253858851033189948 but for some reasons
trying to replicate the example here; http://onertipaday.blogspot.com/2011/07/word-cloud-in-r.html Need help figuring out how to increase
I'm trying to replicate this construct: http://kaitnieks.com/images/divme.png The question consists of 2 parts: 1)
I'm trying to replicate the function seen here: http://en.wikipedia.org/wiki/Window_function#Blackman.E2.80.93Harris_window But I simply can't get
I'm trying to replicate the following exemple : http://www.leigeber.com/2008/04/map-your-users-using-the-google-maps-api-and-php/ How to integrate this PHP
I'm trying to replicate pages like the following using Drupal: http://www.ams-neve.com/Products/Outboard/1073LB/1073LB.aspx My problem is
I am trying to replicate what my C# / XPath code does on Linux
Trying to replicate the Implicit Iterators in Python, using JavaScript my code doesn't return

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.