Jump to content

Mutiple XMLHttpRequest() - Update other divs???


StefanRSA

Recommended Posts

1. -  :shy: I am new to this

2. - Using the following .js file:

 

function makeObject(){
var x;
if (window.ActiveXObject) {
x = new ActiveXObject("Microsoft.XMLHTTP");
}else if (window.XMLHttpRequest) {
x = new XMLHttpRequest();
}
return x;
}
var request = makeObject();

var the_cell;
function check_cell(the_cell){
request.open('get', the_cell);
request.onreadystatechange = parseCheck_cell;
request.send('');
}
function parseCheck_cell(){
if(request.readyState == 1){
document.getElementById('cell').innerHTML = 'Loading...';
}
if(request.readyState == 4){
var answer = request.responseText;
document.getElementById('cell').innerHTML = answer;
}
}
var the_tell;
function check_tell(the_tell){
request.open('get', the_tell);
request.onreadystatechange = parseCheck_tell;
request.send('');
}
function parseCheck_tell(){
if(request.readyState == 1){
document.getElementById('tell').innerHTML = 'Loading...';
}
if(request.readyState == 4){
var answer = request.responseText;
document.getElementById('tell').innerHTML = answer;
}
}

 

My link code is below... All works fine... But if I click on the bottom <div id="tell>

<div id="cell"> display "loading..."

 

How can I get it to only affect the div clicked on?

 

<div id="cell"><a href="javascript:" onClick=\'check_cell("'.$root.'/celltell.php?id='.$adkey.'&get='.$f_value.'")\'>Click to View</a></div>
<div id="tell"><a href="javascript:" onClick=\'check_tell("'.$root.'/celltell.php?id='.$adkey.'&get='.$f_value.'")\'>Click to View</a></div>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.