i am new
struts
i am using
java script to forward to struts action class
and i am using ajax for forwarding
following code i am using
function showCountry(){
alert("show country")
var country=document.getElementById('countries');
//stateContainer.removeChild(document.getElementById('states'));
var action = "showCountry";
var pars='action='+action;
var url='/autoSugession.do';
//document.write("<html:rewrite page='/autoSugession.do?action=showCountry'/> ");
new Ajax.Request(url,
{
method:'get',
parameters:pars,
onSuccess: function(transport){
var response = transport.responseText || "no response text";
country.innerHTML=transport.responseText;
},
onFailure: function(transport){
alert(transport.resposeText+ 'Something went wrong...')
alert('responseHeaders: ' + transport.getAllResponseHeaders());
alert('response header content-length: ' + transport.getResponseHeader('content-length'));
alert('status: ' + transport.status);
alert('statusText: ' + transport.statusText);
alert('responseXML: ' + transport.responseXML);
alert('responseText: ' + transport.responseText);
}
});
}