I have a page which works fine in FF, but not in IE. Here is what is about:
There is the google swfobject JS : http://swfobject.googlecode.com/svn/...t/swfobject.js which is untouched and is ok. Then, I have my code:
Code:
function loadVideo(playerUrl, autoplay) {
swfobject.embedSWF(
playerUrl + '&rel=1&border=0&fs=1&autoplay=' +
(autoplay?1:0), 'player', '640', '380', '9.0.0', false,
false, {allowfullscreen: 'true'});
}
function showMyVideos2(data) {
var html = ['<ul class="videos">'];
var i=0;
var title ="";
var thumbnailUrl ="";
var playerUrl ="";
var desc="";
var rating="";
var views="";
while (i<10) {
title = data.value.items[i].title.substr(0, 60);
thumbnailUrl = data.value.items[i]["media:group"]["media:thumbnail"][0].url;
playerUrl = data.value.items[i]["media:group"]["media:content"][0].url;
desc=data.value.items[i]["media:group"]["media:description"].content.substr(0, 300);
rating=data.value.items[i]["gd:rating"].average;
views=data.value.items[i]["yt:statistics"].viewCount;
html.push('<li>', '<div style="float:left;padding-right:15px;"><img src="',
thumbnailUrl, '" width="130" height="97"/><br />',rating,' * and ',views,' views</div>',
'<a style="padding-left:25px;" href="javascript:void(0);" onclick="loadVideo(\'', playerUrl, '\', true)" class="titlec">', title, '...</a><br />',desc,'<br style="clear:both"/>','</li>');
i++;}
html.push('</ul><br style="clear: left;"/>');
document.getElementById('videos2').innerHTML = html.join('');
if (i.length > 0) {
loadVideo(data[i].value.items[0]["media:group"]["media:content"][0].url, false);
}
}
Hm. Try removing the "javascript:void(0)" from the <a> tag's href attribute. Replace it with "#". Add a ; return false; to the onclick attribute. Maybe the onclick isn't even being triggered because of the "javascript:void(0)" code in the href attribute?
There is no bug shown in Firebug and neither IE displays any error. I think that IE is a very "popular" subject around here, but still is the most used. In this case I've changed the code in several ways and it was still working in FF
Bookmarks