hey guys i have a problem when i'm trying to send two variables by ajax i did the same code w3schools used in this link http://www.w3schools.com/ajax/tryit.asp… but it only works when i use one variable only !! my code :
<script>
function showHintname() {
var ln = document.getElementById("lname").value ;
var fn= document.getElementById("fname").value ;
if (fn.length == 0) {
document.getElementById("txtHint-name").innerHTML = "";
return;
}
else {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("txtHint-name").innerHTML = xmlhttp.responseText;
}
}
//xmlhttp.open("GET", "ini/name.php?f=" + fn , true); // working
// xmlhttp.open("GET", "ini/name.php?f=" + fn &'l=' + ln , true); // not working
xmlhttp.open("GET", "ini/name.php?f=1&l=1", true); // not working
xmlhttp.send();
}
}
</script>