matt burns
matt burns

Reputation: 25410

How can I debug why clicking a link is not working in IE8 / IE9?

I have a simple html link that doesn't do anything in IE8. No errors, it just sits there. It works fine in Chrome and FF. The link is just a clickable image:

<p><a id="google-purchase-link" href="/purchase/google" data-ajax="false"><img src="https://checkout.google.com/buttons/checkout.gif?merchant_id=763453611943044&w=180&h=46&style=trans&variant=text&loc=en_GB" alt="Proceed to Google Checkout"/></a></p>

To try it yourself :

  1. Visit http://www.oddprints.com/checkout
  2. Click "Upload something"
  3. Click "Sample photo"
  4. Click "Order prints"
  5. Click "Buy with Google"

Don't worry, you won't be committing to buy anything!

In IE, the link doesn't seem to work, it just sits there. The link simply points to /purchase/google which builds up the cart server-side and then returns a temporary redirect to the populated Google checkout page. If you visit http://www.oddprints.com/purchase/google it performs the redirect fine.

Any ideas how I can debug this?

UPDATE: The link is being handled with javascript. I have to specifically add the href attribute to window.location to make it work in IE8, however the problem still occurs in IE9.

Changed:

$("#google-purchase-link").click(function(e){   
  _gaq.push(function() {
      var pageTracker = _gaq._getAsyncTracker();
      setUrchinInputCode(pageTracker);
      console.log(getUrchinFieldValue());
      window.location = "/purchase/google?analyticsData=" + getUrchinFieldValue();
  });
  e.preventDefault();
});

to

$("#google-purchase-link").click(function(e){   
  _gaq.push(function() {
      var pageTracker = _gaq._getAsyncTracker();
      setUrchinInputCode(pageTracker);
      console.log(getUrchinFieldValue());
      window.location.href = "/purchase/google?analyticsData=" + getUrchinFieldValue();
  });
  e.preventDefault();
});

UPDATE: the problem was using console.log(). Doh!

Upvotes: 1

Views: 1280

Answers (1)

matt burns
matt burns

Reputation: 25410

Problem was using console.log(). Doh!

Upvotes: 1

Related Questions