Reputation: 45
We are trying to implement Omniture tracking for our site which involves lot of AJAX calls. So we send the omniture code with the response of the AJAX request. This works perfectly for Chrome and other browsers. But we are having problem with IE. This line,
if (navigator.appVersion.indexOf('MSIE') >= 0) document.write(unescape('%3C') + '!-' + '-')
is causing a Access denied
error in IE. Basically what I understand of this is that document.write
will append to the current document if and only when the document
is currently loading. Since ours is an AJAX request, the document
will already be in ready state, and it will cause document.write
to overwrite our whole page with <!--
.
Can someone suggest a way to tackle this issue?
For what versions of IE is this code implemented for? We support IE >= 7 and is it safe if i remove this line?
Upvotes: 2
Views: 2230
Reputation: 1389
This article will prove valuable to you:
Breaking down SiteCatalyst's page-level code
If you don't care about data coming from browsers older than IE7 or non-javascript users, you can just call the s.t()
function by itself.
The noscript tag is there to at least get some data for non-javascript visitors, and the line of code you have in your question is used to stop IE from sending both the regular image request and the noscript tag simultaneously. For some reason, IE executes that noscript tag even if javascript is enabled.
Upvotes: 4