function sendRequest(model,onSuccess){
var request = $.ajax({
type: "GET",
url: URL,
data: model,
// contentType:"text/xml",
processData:true,
cache :false
});
request.done(function( msg ) {
//alert(msg.toSource())
var xmlDoc = $.parseXML( msg );
var $xml = $( xmlDoc );
var $status = $xml.find( "Status" ).first();
var statusText = $status.text();
// alert(statusText);
if(statusText=="Success")
{
onSuccess(msg);
}
else
{
var $Reason = $xml.find("Reason").first();
//alert($Reason.text()+"1");
if($Reason.text() != "") {
var request = $.ajax({
type: "GET",
url: URL,
data: model,
// contentType:"text/xml",
processData:true,
cache :false
});
request.done(function( msg ) {
//alert(msg.toSource())
var xmlDoc = $.parseXML( msg );
var $xml = $( xmlDoc );
var $status = $xml.find( "Status" ).first();
var statusText = $status.text();
// alert(statusText);
if(statusText=="Success")
{
onSuccess(msg);
}
else
{
var $Reason = $xml.find("Reason").first();
//alert($Reason.text()+"1");
if($Reason.text() != "") {