hi all,
I am working on a small assigment but this code just wont work. I dont know what the problem is.
Can anyone please debug it.

var xmlhttp;
function listFriend(){
 xmlhttp = false;
	  /* For Firefox*/	  
      if (window.XMLHttpRequest) { 
         xmlhttp = new XMLHttpRequest();
      } else /*For IE*/
	     if (window.ActiveXObject) { 
         	try {
         	    /*For some versions of IE*/
            	xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
         	} catch (e) {
            	try {
            	  /*For some other versions of IE*/
               	  xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            	} catch (e) {}
      if (!xmlhttp) {
         alert('Cannot create XMLHTTP instance');
         return false;
    var delfrnd = document.forms[0].elements["delFriends"].value;
    var url = "editFriends_ajaxing.php?delFriends="+delfrnd;
    alert(delfrnd+" "+url);
    xmlhttp.open('GET', url, true);
    xmlhttp.onreadystatechange = theResponse;
	//End showUserName
function theResponse(){
 	  alert("entering the function theResponse,readystate= "+xmlhttp.readyState+"status="+xmlhttp.status);
   	if(xmlhttp.readyState==4) {
   		if(xmlhttp.status==200) {
		 alert("inside the iffs");
			var xmlDoctext=xmlhttp.responseText;
			alert("xmlDoctxt is \n"+xmlDoctext);
   			var xmlDoc=xmlhttp.responseXML.documentElement;
			var rootElement=xmlDoc.documentElement;
			alert("xmldoc = "+xmlDoc);
            var htmlArray=[];//An array in which to accumulate HTML fragments in lieu of String += "....".
			htmlArray.push("<table border="1"><tr><th>Friend Name</th><th>Select to Delete</th></tr>");
			var length=xmlDoc.childNodes.length;
alert("htmlArray is \n"+htmlArray);	
			for(var i=0; i<length; i++) {
				alert("Entering the loop with readyState="+xmlhttp.readyState+"and status="+xmlhttp.status);
				var namenode = xmlDoc.childNodes[i];//refers to Friend
				alert("namenode is " + namenode.nodeValue);
				var sname=xmlDoc.childNodes[i].childNodes[0].childNodes[0].nodeValue;//refers to tag sender_username under this Friend tag
				alert("linkE is "+linkE);
				var rname=namenode.childNodes[1].childNodes[0].nodeValue;//refers to receiver_username under Friend
				var user=document.getElementById('userIN').value;
				var dspname="";
				alert("htmlArray is \n"+htmlArray);
				htmlArray.push('<td><input type="checkbox" name="delFriends[]" value='+dspname+'</td></tr>');
				/*var nameNo = namenode.childNodes.length;//refers to no of element under Name
				for(var j=2; j<nameNo; j++){
					var Nam = namenode.childNodes[j];//1st object
					var sibl = Nam.childNodes[0];//its value
					if(sibl != null){ htmlArray.push("<td>"+sibl.nodeValue + "</td>"); }
					else{ htmlArray.push("<td>No Result</td>"); }
			alert("htmlarray = "+htmlArray.join(''));
			document.getElementById("tbl_deleteFriends").innerHTML = htmlArray.join('');
   			alert('There was a problem with the request.'+xmlhttp.status);
	//removed "innerHTML+", and here we use Array.join to put the HTML fragments together

//The page where it is called
		header("Location: login.php");
	$resultAllFriends=mysql_query("select * from friends where (sender_username='$userLoggedIn' or receiver_username='$userLoggedIn') and approved='1'") or die("Cannot execute the query".mysql_error() );
	<script type="text/javascript" src="editfriend_ajax.js"></script>
		<form id="frm_editFriend" action ="" onsubmit="listFriend();return false;">
			<table border="1">
				<div id="tbl_deleteFriends">
					<tr><th>Friend Name</th><th>Select to Delete</th></tr>
					<?php while($rows=mysql_fetch_array($resultAllFriends)){
						$checkbox= $rows['receiver_username'];
					<tr><td><?php echo $rows['receiver_username']; ?></td>
					} else {$checkbox= $rows['sender_username'];
					<tr><td><?php echo $rows['sender_username']; }?></td>
					<td><input type="checkbox" name="delFriends[]" value=<?php echo $rows['receiver_username'];?></td></tr>
				<td><input type="submit" value="submit"/><td>

On line 115 you missed a closing ">" for your checkbox. <td><input type="checkbox" name="delFriends[]" value="<?php echo $rows['receiver_username'];?>" [B]>[/B]</td></tr> Also, line 23 is wrong. The name of your element is NOT "delFriends". Use the exact name you gave the element

Hi try to use jquery for ajax. It will be easy to debug and also reduces the code size