Answer the question
In order to leave comments, you need to log in
How to make an event after the creation of every 9th record?
Friends, how in Js you can make it so that when you add, say, every 9th record, this or that event occurs, another element is added to the page, for example. Only everything happens asynchronously, after each SMS added by ajax, you need to look, if it is the 9th, add an element to the page, if 18, then one more, and so on ... There are no static variables in js, how not to be tell?
Answer the question
In order to leave comments, you need to log in
There are global variables.
var MyGlobalVariable = 0;
(function(){
MyGlobalVariable ++;
if(MyGlobalVariable % 9 == 0){
alert('Супер приз!');
}
})();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question