AJAX - Unknown Runtime Error
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Matt_M
Posted On:   Thursday, April 19, 2007 04:10 PM

document.write (" LOADING "); adGrab(ADtags, ADtitle); function getHTTPObject(){ if(typeof XMLHttpRequest!='undefined') { return new XMLHttpRequest();} try{ return new ActiveXObject("Msxml2.XMLHTTP");} catch (e){try{ return new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}} return false;} function adGrab(ADtags, ADtitle) { myurl = "http://ads.ismywebsite.com/ad.php?title="+ADtitle+"&tags="+ADtags+"&t="+Date.parse(new Date()); http = getHTTPObject(); alert (1); http.open("GET", myurl, true); alert (2); http.onreadystatechange = adShow; al   More>>
			document.write ("
			

LOADING

");
adGrab(ADtags, ADtitle);

function getHTTPObject(){ if(typeof XMLHttpRequest!='undefined') { return new XMLHttpRequest();}

try{ return new ActiveXObject("Msxml2.XMLHTTP");} catch (e){try{ return new

ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}} return false;}

function adGrab(ADtags, ADtitle) {
myurl = "http://ads.ismywebsite.com/ad.php?title="+ADtitle+"&tags="+ADtags+"&t="+Date.parse(new

Date());
http = getHTTPObject();
alert (1);
http.open("GET", myurl, true);
alert (2);
http.onreadystatechange = adShow;
alert (3);
http.send(null);
alert (4);
}

function adShow() {
alert (5);
if (http.readyState == 4) {
var text = http.responseText;
alert (6);
alert("document.getElementById('ad"+ADid+"').innerHTML = '"+text+"'");
alert (7);
var name = 'ad'+ADid;
alert (name+"-"+text);
if (document.getElementById) {
document.getElementById(name).innerHTML = text;
alert (8);
}
else if (document.all) { document.all[name].innerHTML = http.responseText; alert (9);}
else if (document.layers) { document.layers[name].innerHTML = http.responseText; alert (10);}
}
alert (11);
}

Line 28, Char 4 apparantly. As you can see by all the alerts, I'm doing a lot of debugging.

See my code live at http://ads.imywebsite.com/adtest2.php

I've been messing with this for a couple days already...
   <<Less

Re: AJAX - Unknown Runtime Error

Posted By:   Robert_Lybarger  
Posted On:   Thursday, April 19, 2007 07:47 PM

This line...
if (document.getElementById) {

... looks suspicious, IMO.
About | Sitemap | Contact