i have the following code in ajax.can you help how to refresh the particular part of the div or part of the web page?
here in this code the record is inserted but the div isnot get refreshed.
here in this code the record is inserted but the div isnot get refreshed.
Code:
function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { return new XMLHttpRequest(); } else if(window.ActiveXObject) { return new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your Browser Sucks!\nIt's about time to upgrade don't you think?"); } } //Our XmlHttpRequest object to get the auto suggest var searchReq = getXmlHttpRequestObject(); [B]//code for insert[/B] var nocache = 0; function insert(DivID,Idname,SeqNo,Status) { alert("Div ID :"+DivID) alert("IDName :"+Idname) alert("SeqNo :"+SeqNo) alert("Status :"+Status) var DivID = DivID; var name = Idname; var dip = SeqNo; var sta = Status; document.getElementById(DivID).innerHTML = "Just a second..." nocache = Math.random(); alert("nocache="+nocache) searchReq.open('get', 'insert1.jsp?IDENTIFICATION_TYPE.DISPLAY_NAME='+name+'&IDENTIFICATION_TYPE.DISPLAYORDER=' +dip+'&IDENTIFICATION_TYPE.STATUS = '+sta+'&mode=insert'); //searchReq.open("GET",''+Page+'?divIDName='+divID+'&accessMode='+mode+'&fieldID1='+fieldid1+'&fieldName1='+fieldname1+'&fieldName2='+fieldname2+'&filterValue='+filtervalue, true); searchReq.onreadystatechange = insertReply; searchReq.send(null); } function insertReply() { if(searchReq.readyState == 4){ var response = searchReq.responseText; // else if login is ok show a message: "Site added+ site URL". document.getElementById(DivID).innerHTML = '<font color="#ccdb29">Added</font>'+response; alert("Response"+ responseText); document.getElementById(DivID).innerHTML = reload(); } }
Comment