Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xmlHttp Request I getting the whole page to load inside

Status
Not open for further replies.

wrighterb

Programmer
Feb 20, 2007
80
US
I just need to send #curredate# back to my calendar so it updates, right now I get the entire page getting jammed into where the calednar is suppose to be on the original page.

Click the right arrow for the additional month.
To see

<script>
function createRequestObject() {
var req;
if(window.XMLHttpRequest){
// Firefox, Safari, Opera...
req = new XMLHttpRequest();
} else if(window.ActiveXObject) {
// Internet Explorer 5+
req = new ActiveXObject("Microsoft.XMLHTTP");
} else {
// There is an error creating the object,
// just as an old browser is being used.
alert('Problem creating the XMLHttpRequest object');
}
return req;
}
// Make the XMLHttpRequest object
var http = createRequestObject();
function sendRequest(act) {
// Open PHP script for requests
http.open('get', 'rental_details.cfm?currdate=' + "#dateadd('m',1,currdate)#" + '&ID=' + '#ID#');
http.onreadystatechange = handleResponse;
http.send(null);
}
function handleResponse(){
if(http.readyState == 4 && http.status == 200){
// Text returned FROM the cfm
var response = http.responseText;
if(response) {
// UPDATE ajaxTest content
document.getElementById("ajaxTest").innerHTML = response;
}
}
}
</script>

<table class="cal_Struct" id="ajaxTest">
 
Have you looked at what's in responseText? Sounds like you're calling a template that generates the entire page instead of just the calendar HTML.

Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
Pity the insomniac dyslexic agnostic. He stays up all night, wondering if there really is a dog.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top