Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var timer = {};
- function pdf_loop_check(loan_id){
- timer[loan_id] = setInterval(function(){
- pdf_statusChecker(loan_id);
- }, 10000);
- }
- function pdf_statusChecker(loan_id) {
- $.ajax({
- type: "GET",
- url: "/hellosign/checkloanstatus/" + loan_id,
- dataType: "json",
- async: true,
- success: function (data) {
- if ((data.status == 'electronic_sign_complete' && data.coborrower == false) || (data.status == 'electronic_sign_waiting_co_borrower' && data.coborrower == true)) {
- console.log('pdf done');
- $('#generating_pdf_' + loan_id).html('<a href="/download_pdf/' + loan_id +'" target="_blank"><i class="fa fa-floppy-o"></i> Download PDF</a>');
- clearInterval(timer[loan_id]);
- }
- },
- error: function (data) {
- console.log('ajax for ' + loan_id +'finish errors.');
- console.log(data);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement