Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use ajax

 
shyamkumar bopannachengalaiah
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


function ajaxfrmconfiginst(v1,v2,v3,v4,v5)
{
//alert("¤cy="+getValue(v6));
var address="FormNoConfigInst";

var data = "term="+getValue(v1)+"&invalidlogin="+getValue(v2)+"&frmstartno="+getValue(v3)+"&receiptno="+getValue(v4)+"¤cy="+getValue(v5);
//lert(data);
issueResultPost(address, data);
}


/*Ajax for form fields insert*/
function issueResultPost(address, data) {
//alert(address+""+data);
var request = getRequestObject();
request.onreadystatechange =function()
{issueResponseText(request); };
request.open("POST", address, true);
request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//alert(data);
request.send(data);
}


function issueResponseText(request) {

if ((request.readyState == 4) && (request.status == 200)) {
var str=request.responseText;
alert(str);

}
}




function getRequestObject() {
if (window.ActiveXObject) {
return(new ActiveXObject("Microsoft.XMLHTTP"));
} else if (window.XMLHttpRequest) {
return(new XMLHttpRequest());
} else {
return(null);
}
}


function getValue(id) {
return(escape(document.getElementById(id).value));
}

try { console.log("Loading script");
} catch(e) { console = { log: function() {} }; }
 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use code tag when your question contains code.

read this Use Code Tags ..
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on JSP. For more information, please read this.

This post has been moved to a more appropriate forum.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64629
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also what's your question? All you've done is to post unreadable code.
 
Himanshu Kansal
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After skimming through your code, which actually required a lot of effort, I could only see that you are using ajax already and that to pretty fine. If this is your code then please rephrase the question, else please quote the source and place your question clearly
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic