Answer the question
In order to leave comments, you need to log in
How to implement a program change using the interface?
Hello, I'm interested in this question:
Let's say we have some block of code:
If(var){
do this;
}
Answer the question
In order to leave comments, you need to log in
1. The specific implementation depends on the project, the subject area, what the code does when it is executed, and other things.
2. The variable does not have to be global.
3. I advise you to read about MVC , though I'm not sure that in this case it is needed.
Using his psychic abilities, he came to the conclusion that after all, through the base.
I understand that the question is about UI changes on the client, because otherwise I think there would be no questions.
There is such a pattern as MVVM. it is implemented by a bunch of frameworks ala Knockout.js, Angular.JS, etc. These frameworks allow you to build complex UIs using a declarative approach and data binding. That is, you will have an instant UI reaction to a change in some data or the state of the model.
In fact, you can implement something simpler for a specific task, but in any case, everything that happens on the client is written in JS.
How do you track the state of the radio button?
Let's say, depending on the state, the radiobutton_state variable changes, switching between ENABLED and DISABLED values.
Then in code you can write:
If ((var) && ( radiobutton_state == ENABLED){
do this;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question