Hi,

I'm trying replace a META REFRESH every 5 secs with AJAX.
On Submit of the form, I'd like to trigger the process, and use
SetInterval
to check a URL whether it has finished.
Right now, the trigger will call a program callEquifax, which will
display a
page with another META REFRESH until the program is ready to display a
result where the META REFRESH URL is the final output.

Now I'd like to replace this using AJAX, here's what Ive attempted
below but
I'm missing a way to analyse the URL, not the output html, and if I
detect a
change in the location.href.

Bottomline, how can I modify it so that, on Submit:
1. It displays the Loading Icon
2. HTTP AJAX POST callEquifax
3. Check every 5 secs using AJAX to see if the process has ended, if
not
loop again.
4. Finally refresh the page to the new Page to show the output when it
is
ready to be displayed.

Thanks

Below is the snippet on where I am at... I was able to trigger the
process,
and I am trying to replace a META REFRESH URL

$(function(){
        $('#Submit').click(function(){
                //Loading
                alert('AJAX Submit Function');
                $('<div id="overlay"/>').appendTo('body').fadeIn(500);
                $.ajax({
                        type: "POST",
                        url: "/eDevScripts/MGrqispi101.dll",
                        data:
"APPNAME=CreditApp&PRGNAME=callEquifax&ARGUMENTS=-
A2408895331377327030220090
90018&prgtype=ADD&customerType=" + $('#customerType').val()+
"&businessName=" + $('#businessName').val() + "&fileNumber=" +
$('#fileNumber').val() + "&listSimilars=" + $('#listSimilars').val() +
"&firstName=" + $('#firstName').val() + "&lastName=" + $
('#lastName').val()
+ "&dob=" + $('#dob').val() + "&streetNo=" + $('#streetNo').val() +
"&streetName=" + $('#streetName').val() + "&city=" + $('#city').val()
+
"&province=" + $('#province').val() + "&postalCode=" +
$('#postalCode').val() + "&phoneNumber=" + $('#phoneNumber').val() +
"&ext="
+ $('#ext').val(),
                        success: function(htmlOutput){
                                alert("Please wait while we process
the
transaction!" + htmlOutput);
                                // Need a way to use SetInterval()
                        }
                });
                return false;

        });


});

Reply via email to