Hello everyone…
Site #1 is suppose to load images from an XML file on Site #2. So in the header of Site #1 I’m using this line:
[CODE]
<script language=”JavaScript” src=”http://www.sociallyaffluent.com/volumestat_feed.js”></script>
The JavaScript AJAX call is the same one that I use to make a successful call for another feature on another site. So I’m not understanding why I’m getting a 500 or 404 error… Can anyone see anything?
Code:
[CODE]
// JavaScript Document
window.onload=function(){
xmlSearch();
}
function xmlSearch(){
var browsername=navigator.appName;
var browserversion=parseInt(navigator.appVersion);
var request=null;
var xml_response=null;
if (window.XMLHttpRequest) {
request=new XMLHttpRequest();
} else if (window.ActiveXObject) {
request= new ActiveXObject(“Microsoft.XMLHTTP”);
}
if (request){
var url_xml = “vstat_images.xml?dt=”+new Date().getTime();
request.open(“GET”,url_xml);
request.onreadystatechange=
function(){
if ((request.readyState==4)&&(request.status==200)){
if ((browsername.indexOf(“Microsoft”) != -1) && (browserversion >= 4)){
xml_response=new ActiveXObject(“Microsoft.XMLDom”);
xml_response.loadXML(request.responseText);
}
else
{
xml_response=request.responseXML;
}
displayXMLFile(xml_response);
}
else if ((request.status==500)||(request.status==404))
{ alert(“Sorry having loading issues.”)}
}
request.send(null);
}else{
alert(“Sorry, update the browser to see Ajax in action”);
}
}
function displayXMLFile(xml_response){
document.write(‘<div style=”border-bottom:1px solid #6a6a6a; width:300px; height:25px; color:#6a6a6a; font-family:Times New Roman; font-size:22px;”>ATL Events</div>’);
document.write(‘<div style=”width:300px; height:750px; margin-top:5px;”>’);
var targ_item=xml_response.getElementsByTagName(‘item’)[0];
var img1=targ_item.getElementsByTagName(‘img1’)[0].firstChild.data;
var img2=targ_item.getElementsByTagName(‘img2’)[0].firstChild.data;
var img3=targ_item.getElementsByTagName(‘img3’)[0].firstChild.data;
var img4=targ_item.getElementsByTagName(‘img4’)[0].firstChild.data;
var img5=targ_item.getElementsByTagName(‘img5’)[0].firstChild.data;
var img6=targ_item.getElementsByTagName(‘img6’)[0].firstChild.data;
document.writeln(‘<div style=”margin-top:0px; margin-left:-1px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img src=”‘+$img1+'” width=”110″ height=”126″ /></a></div>’);
document.writeln(‘<div style=”margin-top:-131px; margin-left:115px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img src=”‘+$img2+'” width=”110″ height=”126″ /></a></div>’);
document.writeln(‘<div style=”margin-top:5px; margin-left:-1px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img src=”‘+$img3+'” width=”110″ height=”126″ /></a></div>’);
document.writeln(‘<div style=”margin-top:-131px; margin-left:115px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img src=”‘+$img4+'” width=”110″ height=”126″ /></a></div>’);
document.writeln(‘<div style=”margin-top:5px; margin-left:-1px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img src=”‘+$img5+'” width=”110″ height=”126″ /></a></div>’);
document.writeln(‘<div style=”margin-top:-131px; margin-left:115px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img src=”‘+$img6+'” width=”110″ height=”126″ /></a></div>’);
document.writeln(‘</div>’);
document.writeln(‘<div style=”margin-left:0px; margin-top:0px;”><a href=”http://www.sociallyaffluent.com” target=”_blank”><img style=”border:none;” src=”http://www.sociallyaffluent.com/Images/sa_vol_logo.jpg”></a></div>’);
}