I'm part of a world of warcraft guild, with a website hosted on guildportal.com. While trying to improve our website, i've implemented a custom rss feed that would pull the most current WoW news from mmo-champion.com to my frontpage. The script works correctly, but the problem is that on firefox, the feed gets cut off, while on IE (7 or 8) and chrome, it displays the full feed correctly.
My script is:
<div id="feed"></div>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>;script type="text/javascript">
google.load("feeds");
$(document).ready(function() {
var myfeeds = new Array();
var feedBox = "feed";
var tooltipWidth = 560;
var previewMode = true;
var previewLength = 80000;
var readMoreMessage = "...<br><br><img align=right src=http://i201.photobucket.com/albums/aa236/Mottie1/testsite/styles/moreinfo.gif>;";
myfeeds.push (["MMO-Champion","http://www.mmo-champion.com/index.php?type=rss;action=.xml;board=2.0;sa=news;",1// **************************************
// Do not change anything below this line
// **************************************
var ttcss = "#dhtmltooltip";
var ttBrdr = $(ttcss).css("border-width");
var ttBkgd = $(ttcss).css("background-color");
$("#"+feedBox)
.mouseover(function(){$(ttcss).css("border-width","0").css("background-color","transparent")})
.mouseout (function(){$(ttcss).css("border-width",ttBrdr).css("background-color",ttBkgd)});
for (var k = 0; k < myfeeds.length; k++) {
feedResult(myfeeds[k]);
}
function feedResult(currentFeed) {
var feed = new google.feeds.Feed(currentFeed[1]);
feed.setResultFormat(google.feeds.Feed.XML_FORMAT);
feed.setNumEntries(currentFeed[2]);
feed.load(function(result) {
if (!result.error) {
var ftitle = (currentFeed[0] == "") ? (result.xmlDocument.getElementsByTagName("title")[0].firstChild.nodeValue) : (currentFeed[0]);
var feedText = "<div class='feedTitle'>" + ftitle + "</div>";
var items = result.xmlDocument.getElementsByTagName("item");
for (var j = 0; j < items.length; j++) {
var titleElement = items[j].getElementsByTagName("title")[0];
var xtitle = titleElement.firstChild.nodeValue;
var titleElement = items[j].getElementsByTagName("link")[0];
try {var xlink = titleElement.firstChild.nodeValue;} catch(e) {xlink = "";}
var titleElement = items[j].getElementsByTagName("pubDate")[0];
try {var pubDate = titleElement.firstChild.nodeValue;} catch(e) {pubDate = "";}
var titleElement = items[j].getElementsByTagName("description")[0];
try {var descript = titleElement.firstChild.nodeValue;} catch(e) {descript = "";}
pubDate = pubDate.replace(/'/g,"\'").replace(/\"/g,'\"');
descript = descript.replace(/'/g,"\'").replace(/\"/g,'\"');
if (previewMode) {
var dStart = descript.indexOf("<br>") + previewLength;
if (descript.length > dStart) {descript = descript.substring(0,dStart) + readMoreMessage;}
}
var feedPopup = '<div><table class=tooltip><tbody><tr><td class=tooltiplt>';
feedText += '<div class=feedDate>' + pubDate + '</div><div class=feedDesc>' + descript + '</div>';
feedText += '</td><td class=tooltiprt> </td></tr><tr><td class=tooltiplb> </td>';
feedText += '<td class=tooltiprb> </td></tr></tbody></table></div>';
}
feedText += '<br>';
document.getElementById(feedBox).innerHTML += feedText;
} else { alert ("feed error from " + currentFeed[0]); }
});
}
});
</script>
Does anyone have a clue on what it might be wrong?
My guild website is cont.guildportal.com if you want to see the script live to confirm the bug, its just below the news on the frontpage.
I care more about ethical LLMs than open source LLMs. Would be great if they declare that the training data was sourced without copyright infringement.
Question
Koopie
I'm part of a world of warcraft guild, with a website hosted on guildportal.com. While trying to improve our website, i've implemented a custom rss feed that would pull the most current WoW news from mmo-champion.com to my frontpage. The script works correctly, but the problem is that on firefox, the feed gets cut off, while on IE (7 or 8) and chrome, it displays the full feed correctly.
My script is:
Does anyone have a clue on what it might be wrong?
My guild website is cont.guildportal.com if you want to see the script live to confirm the bug, its just below the news on the frontpage.
Thanks in advance.
Edited by KoopieLink to comment
https://www.neowin.net/forum/topic/737916-javascript-doesnt-render-correctly-on-firefox/Share on other sites
13 answers to this question
Recommended Posts