Hi,
I am getting an error while taking feeds for our organization. Apparently that URL was down for a while.
In the bold line above, in that file:
In case the URL is down, how do I display just a simple text saying that the "No News" instead of causing the entire intranet to crash.
Error I was getting is:
Line 22 in RSSParser.inc is: (In bold)
Thanks.
I am getting an error while taking feeds for our organization. Apparently that URL was down for a while.
Code:
<!-- ****************** Begin News Modules ****************** -->
<style>
body {font-family: Verdana, Arial, Helvetica, sans-serif;}
div.news-header-employee {background-color:#9090f9; font-size: 75%; font-weight: bold; color: #ffffff; padding:2px; text-align:center;}
div.news-header-industry {background-color:#9090f9; font-size: 75%; font-weight: bold; color: #ffffff; padding:2px; text-align:center;}
</style>
<div style="margin:0px 5px 0px 5px">
<div class="news-header-employee">Company Employee News</div>
<!--#include virtual="/inc/RSSParser.inc"-->
<!--#include virtual="/inc/NewsDB_Company.inc"-->
Code: <!--#include virtual="/inc/NewsRSS_Company.inc"--> <br />
<div class="news-header-industry">Industry News</div>
<!--#include virtual="/inc/NewsRSS_Yahoo.inc"-->
<br />
</div>
<!-- ****************** End News Modules ****************** -->
In the bold line above, in that file:
Code:
<script language="JScript" runat="Server">
// Create XML Object
var rssURL = "[URL unfurl="true"]http://my.company.com/intranet/feed.jsp?feed=rss/broadcast&pt=intranet/cas&c=e"[/URL]
var newsCompany = getXMLObject(rssURL);
</script>
In case the URL is down, how do I display just a simple text saying that the "No News" instead of causing the entire intranet to crash.
Error I was getting is:
Code:
Error Type:
msxml3.dll (0x800C0005)
The system cannot locate the resource specified.
/inc/RSSParser.inc, line 22
Line 22 in RSSParser.inc is: (In bold)
Code:
<script language="JScript" runat="Server">
/*********************************************
CORE XMLHTTPREQUEST OBJECT
Grabs an XML document, and converts it to a XMLDOM
object so that it can be parsed with DOM methods.
*********************************************/
function getXMLObject(url) {
var xmlhttp, xmldoc;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
xmlhttp.open("GET", url, false);
xmlhttp.send(null); //return xmlhttp.ResponseText;
xmldoc=Server.CreateObject("Microsoft.XMLDOM");
xmldoc.async=false;
xmldoc.loadXML(xmlhttp.ResponseText);
if (xmldoc.parseError.errorCode != 0) {
Response.Write("<HR>");
Response.Write("XML Parser Error on Line:");
Response.Write(xmldoc.parseError.line);
Response.Write(", Character:");
Response.Write(xmldoc.parseError.linePos);
Response.Write("<BR>");
Response.Write(xmldoc.parseError.srcText);
Response.Write("<HR>");
}
return xmldoc;
}
Thanks.