O
O
Oleg Galimov2018-02-12 07:39:09
JavaScript
Oleg Galimov, 2018-02-12 07:39:09

Open new ajax function if button is in previous ajax condition?

Good time of the day.
Tell me how to open a new ajax function if the button is in the condition of the previous ajax?
Here is the code

success: function(xml) {
  if ($(xml).find('domain').text() == ''){
  }
  else
  {
  $('#result').append('<input class="button" type="submit" onclick="getRrRecords();" name="getRrRecords" value="Получить">');
  }
  }
  });
  }
  });//Конец первого ajaxPostXML
function getRrRecords() {
  alert('test');
}

I tried to open it through the class, onclick, the button just stupidly reloads the page, the alert does not come out
Help me figure out what I'm doing wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question