travisbrown
Technical User
- Dec 31, 2001
- 1,016
I'ma bit confused. I have this simple remote call script, but when i call it twice to load two different objects, It only seems to work for the last call. It seems like one is preempting the other. Make sense?
These are executed after both target ids are loaded.
Code:
function createRequestObject() {
var ro;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
ro = new ActiveXObject("Microsoft.XMLHTTP");
}else{
ro = new XMLHttpRequest();
}
return ro;
}
var http = createRequestObject();
function sndReq(page,target) {
http.open( 'get', page );
http.onreadystatechange = function(){
if ( http.readyState == 4 ) {
var response = http.responseText;
document.getElementById(target).innerHTML = response;
}
};
http.send(null);
}
These are executed after both target ids are loaded.
Code:
<script type="text/javascript">
sndReq('pop_contact_timeoff.asp?contact_id=123&mode=display','contact_time_off');
sndReq('pop_contact_timeoff.asp?contact_id=123&mode=display','contact_notes');
</script>