There is such code:
loadContent = { limitAjax: 0, start: function (btn) { console.log(this.limitAjax); // not equal 4 // Ajax response this.limitAjax = response.limit; // response.limit = 4 } }
Ajax returns the new limit value that is assigned to this.limitAjax
. But the next time the function is called, the value of this.limitAjax
is still = 0.
Do not want to make a superglobal variable ...