Is there any chance that the contents of .html cannot be captured depending on whether or not the pre-alert operation is performed (JQuery)?

Asked 2 years ago, Updated 2 years ago, 45 views

Thank you all for your continued support.
====Question ====
Is it possible that the behavior changes (the contents of the variables in the array change?) just by the presence or absence of an Alert statement?If so, in what cases?

==== Details ====
The downtotalCalc function in the coding below does not perform the expected behavior only when called for the first time.
If you put an Alert statement in front of the root part you want to operate in that function, it will pass through the root part safely.However, when you comment out the Alert statement, it doesn't pass through the root!!
The Alert statements themselves are intended to identify the factors that are currently occurring that "only the first time does not pass through the foundation."When entering or not entering the root, the variable values are coded so that they work with conditional expressions that are set or not.
However, I was wondering if the variable contents of the array were linked to this because the behavior has changed only by the presence or absence of an Alert statement.

INPUT= QUANTITY FRAME ON TABLE LINE shows unit price from DB (Ajax) in the label column of the same LINE, and another label column shows unit price multiplied by quantity.
There is a total list at the end of the table, so I would like to display the total amount of the details here (not done).

If I go back to the original point, is this the result of the movement related to unit price acquisition in the details achieved by Ajax?Is it an event where you can escape with setTimer...

// If the focus is off the quantity text box,
$(" input [ name = amount ]").on("blur", function(){

    // [Omitted] When the value is included in the quantity frame (INPUT) on the table detail, the amount is displayed on the label next to it.

    // [To the function in question] I want to display the total at the end of the table along with the above operation (change)!! 
    downtotalCalc();
});


// Problem function (under experiment)
function downtotalCalc(){
    var$totalp=$("label[name=totalp]");

    console.log($totalp);
//$$    alert("###Tonight is Yamada ####";// 【The first action of the function depends on this line, the For statement below does not pass しない
    // Line 1 is hidden, so loop starts at exponent [1]
    for (vari=1;i<$totalp.length;i++){
        if($totalp.eq(i).html()!="&$totalp.eq(i).html()!=0&$totalp.eq(i).html()!="0"){
            alert("###Tonight is Yamada 2["+i+"]###";
        }
    }
    alert("###Tonight is Yamada3###";
}

javascript jquery

2022-09-30 18:56

1 Answers

As I added to the comment myself, I was able to realize from both of your perspectives that detection is essential when implementing related actions after using Ajax.Thank you.


2022-09-30 18:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.