Conflict with this that I get in the function when I click, with this AJAX

-1

How do I remove the variable conflict? I already tried to put in a variable the outside of it to not generate conflict with the aJAx THIS, even though it did not change anything!

    
asked by anonymous 24.03.2018 / 20:39

1 answer

1

Just an example, but I believe it makes interpretation easier.

var thisdobotao = this;

var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
   var thisdafuncao = this;

   thisdobotao.html('Carregando...')
};
    
24.03.2018 / 21:02