Click here to Skip to main content
15,912,069 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Why we need to open inspect element or fire alert message to execute jquery function further.

I used bootstrap modal popup to show progress by (enabling progress bar on modelpopup)
some time it doesn't response when I enable inspect element or write console log it started to run...


Here is code----
jquery
 $(document).on('click', '#btnP', '', function () {        
        $('#temp').html('');
        $('#temp').append($('#drop-field').html());
          First("Test");
    });


function First(e) {

    if ($('#btnPrinterName').find('span').eq(0).text() == 'Select Printer Name') {
        alert('Please Select Printer Name');
        return false;
    }
    $('#divProgressBar').css('width', "0px");
    $('#myModall').modal({ backdrop: 'static', keyboard: false });
    console.log($('#temp').html());///If i wont write this log my jquery fucntions is not executing after using sometime also need to enable inspact element or call alert function

    $.ajax({//----------------------------------------------------- For First function
        type: "GET",
        contentType: "application/json;charset=utf-8",
        url: 'http://apiNW.com/api/forFirst',
        dataType: "json",
        success: function (data) {
            $.each(data[Object.keys(data)[0]], function (key, value) {
                if ($('#temp').children("span[data-key='" + key + "]").length)
                { $('#temp').children("span[data-key='" + key + "]").text(value); }
            });
            $('#progress').css('width', "42px");
            Second(e);

        },
        error: function (data) {
            $.ajax(this);
        }
    });


}
//---------------------------------------------------------- For Second Function
function Second(e) {
    $.ajax({
        type: "GET",
        contentType: "application/json;charset=utf-8",
        url: 'http://apiNW.com/api/forSecond',
        xhrFields: { withCredential: true },
        dataType: "json",
        success: function (data) {
            $.each(data[0], function (key, value) {
                if ($('#temp').children("span[data-key=" + key + "]").length) { $('#temp').children("span[data-key=" + key + "]").text(value); }
            });
            $('#progress').css('width', "84px");
            Third(e);
        },
        error: function (result) {
            $.ajax(this);
            console.log(result);
        }
    });
}
Posted
Updated 22-Oct-15 12:28pm
v4
Comments
Richard Deeming 22-Oct-15 11:06am    
There's an error in your code. Since you haven't shown your code, we can't help you find it.
Sheriffff 26-Oct-15 5:53am    
See the code. It is allready attached
ZurdoDev 22-Oct-15 11:21am    
We have no idea what you have done. Click Improve question and improve the question.
Krunal Rohit 22-Oct-15 12:08pm    
Again, the invisible code !

-KR
Look at your console window of develops tool to know id there are any errors in your code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900