O
O
Oleg Galimov2018-02-12 15:43:34
JavaScript
Oleg Galimov, 2018-02-12 15:43:34

Run Ajax function after button click?

Good time of the day.
Can you tell me how to run the Ajax function after clicking on the button?
I know that it is possible to do without a function, but, by the code, the same ajax request occurs many times, I just want to refer to this ajax function.
For example

$('#getrecord').submit(function(e){
  e.preventDefault();
// Как запустить function getRrRecords() ?
});
  function getRrRecords(){
    $.ajax({
      type: "POST",
      cache: false,
      url: "/1/library/getrerecords.php",
      data: 
      dataType: "json",
      success: function(data){
}
});

Help solve the problem.

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