mattboy_slim
12-09-2009, 07:30 PM
I have been searching online for hours, but it is possible I'm just not thinking of the correct keywords. I have included a basic illustration of the current setup (which does not work). The issue lies with the page that is the desired output. I have a far deeper issue which I have narrowed down to javascript on the final .asp page not loading at all.
http://startuplink.com/ajaxissue.png
On default.asp, I am calling a function contained in 'ajax_call-contentselection.js'
<a onclick="func_displaycontents('restaurants'); return false">displayajaxcontent</a>
Honestly, I don't believe the following piece of code (ajax_call-contentselection.js) is relevant, as it is standard ajax code, but just in case:
function func_displaycontents(var_type){
var xmlHttp = GetXmlHttpObject();
var url = "../_include/ajax_display-contentselection.asp";
url += "?type="+var_type;
if (!xmlHttp){
alert ("Browser does not support HTTP Request")
return
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 1){
document.getElementById("div_ajaxfillattractions").innerHTML = "<div style='padding-top:50px;color:white;width:930px;text-align:center;'><img src='../_images/ajax-loader.gif'/><br/>Loading...</div>";
};
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
document.getElementById("div_ajaxfillattractions").innerHTML=xmlHttp.responseText;
}
};
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
The other contents of "ajax_display-contentselection.asp" are displayed properly in "div_ajaxfillattractions" of "default.asp", but no javascript code on that page loads. If I use "ajax_display-contentselection.asp" as an include file on "default.asp", I get the javascript alert of 'Success', but when I initiate the AJAX it does not work, so I know there isn't a problem with the javascript.
Please let me know if I sucked at explaining something, or more detail is needed.
Thanks in advance,
Matt
http://startuplink.com/ajaxissue.png
On default.asp, I am calling a function contained in 'ajax_call-contentselection.js'
<a onclick="func_displaycontents('restaurants'); return false">displayajaxcontent</a>
Honestly, I don't believe the following piece of code (ajax_call-contentselection.js) is relevant, as it is standard ajax code, but just in case:
function func_displaycontents(var_type){
var xmlHttp = GetXmlHttpObject();
var url = "../_include/ajax_display-contentselection.asp";
url += "?type="+var_type;
if (!xmlHttp){
alert ("Browser does not support HTTP Request")
return
}
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState == 1){
document.getElementById("div_ajaxfillattractions").innerHTML = "<div style='padding-top:50px;color:white;width:930px;text-align:center;'><img src='../_images/ajax-loader.gif'/><br/>Loading...</div>";
};
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
document.getElementById("div_ajaxfillattractions").innerHTML=xmlHttp.responseText;
}
};
xmlHttp.open("GET", url, true);
xmlHttp.send(null);
}
The other contents of "ajax_display-contentselection.asp" are displayed properly in "div_ajaxfillattractions" of "default.asp", but no javascript code on that page loads. If I use "ajax_display-contentselection.asp" as an include file on "default.asp", I get the javascript alert of 'Success', but when I initiate the AJAX it does not work, so I know there isn't a problem with the javascript.
Please let me know if I sucked at explaining something, or more detail is needed.
Thanks in advance,
Matt