Thanks Pepejeria
well, the two functions are -
Code:
function ajaxFunction(){
var ajaxRequest; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequest = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your are using an old browser or you have disabled javascript. In either condition, this code won't work!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
var ajaxDisplay = document.getElementById('ajaxDiv');
ajaxDisplay.innerHTML = ajaxRequest.responseText;
}
}
box = document.forms[0].nlone;
var age = document.getElementById('nlone').value;
<? if ($thisq!='') { ?>
if (age == '') {
age = <?=$thisq?>;
}
<? } ?>
var queryString = "?q=" + age + "&lv_id=<?=$lv_id?>&sid="+Math.random();
ajaxRequest.open("GET", "getlivra.php" + queryString, true);
ajaxRequest.send(null);
}
and
Code:
function livrFunction(){
var ajaxRequests; // The variable that makes Ajax possible!
try{
// Opera 8.0+, Firefox, Safari
ajaxRequests = new XMLHttpRequest();
} catch (e){
// Internet Explorer Browsers
try{
ajaxRequests = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequests = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
// Something went wrong
alert("Your are using an old browser or you have disabled javascript. In either condition, this code won't work!");
return false;
}
}
}
// Create a function that will receive data sent from the server
ajaxRequests.onreadystatechange = function(){
if(ajaxRequests.readyState == 4){
var ajaxDisplays = document.getElementById('ajaxLivr');
ajaxDisplays.innerHTML = ajaxRequests.responseText;
}
}
boxs = document.forms[0].nlone;
var ages = boxs.options[boxs.selectedIndex].value;
<? if ($thisq!='') { ?>
if (ages == '') {
ages = <?=$thisq?>;
}
<? } ?>
var queryStrings = "?pq=" + ages + "&newnl=<?=$rapportid?>&newnl2=<?=$newnl2?>&newnl3=<?=$newnl1?>&sid="+Math.random();
ajaxRequests.open("GET", "getarticle.php" + queryStrings, true);
ajaxRequests.send(null);
}
Basically they are same, i've just changed the variable names ...
Later, I called them with select onchange, as the first post, and getting the "unknown" error. What do you think here?
Bookmarks