PDA

View Full Version : Switch Content. Object Required Error from IE 6



azaniaman
12-03-2011, 09:35 PM
1) Script Title: Switch Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent.htm

3) Describe problem: No problems with any other browsers, only IE 6. Unfortunately a lot of our visitors are still using this browser so I would like to see if the error can be eliminated.
Expanding or collapsing any content triggers an IE error:
Line: 93
Char: 25
Error: Object required
Code: 0
Despite the error, the page works and content can be expanded and collapsed.
Test page up at http://www.yesispeakenglish.com/r03/en/faq.php

I have tried a search and was able to find out how poplular IE 6 is around here, but nothing that would point me in the right directlon.
Thank you.
(I am very new at all of this)

jscheuer1
12-03-2011, 10:42 PM
It's also an error in IE 7, 8, and 9. IE 9 could handle it if the page weren't in quirksmode. But 6, 7, 8 can't deal with it either way.

And it's not an error in the Switch Content script, although I'm pretty sure there's something in there that's involved in some way, but perhaps not. The error is from the SpringMetrics tracker script, specifically the a.js file which SpringMetrics tracker imports to the page:


var _springMetq = _springMetq || [];
_springMetq.push(['id', '0f2640392b']);
(
function(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = ('https:' == document.location.protocol ? 'https://d3rmnwi2tssrfx.cloudfront.net/a.js' : 'http://static.springmetrics.com/a.js');
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
)();

If you were to remove all that code the error should go away.

Or you could comment it out for all IE:


<script type='text/javascript'>
/*@cc_on @*/
/*@if(@_jscript_version >= 5)
if(1 !== 1){
@end @*/
var _springMetq = _springMetq || [];
_springMetq.push(['id', '0f2640392b']);
(
function(){
var s = document.createElement('script');
s.type = 'text/javascript';
s.async = true;
s.src = ('https:' == document.location.protocol ? 'https://d3rmnwi2tssrfx.cloudfront.net/a.js' : 'http://static.springmetrics.com/a.js');
var x = document.getElementsByTagName('script')[0];
x.parentNode.insertBefore(s, x);
}
)();
/*@if(@_jscript_version >= 5)
}
@end @*/
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
</script>

azaniaman
12-03-2011, 10:56 PM
John, thank you for nailing this one. I have spent days searching and trying whatever I could find but never got anywhere.
In my searches I kind of got to know you and knew that you would know what the problem was. It is amazing so see you post a solution ... and so quickly.
My sincere thanks.