I would like to know how to make ajax call in div without button click in javascript
Also, I will pass corresponding id to the ajax function in javascript
function handleCall(pr_id) {
  var li = $.ajax({
    url: "/en/send-money-from-" + sourcecn + "-to-" + targetcn,
    method: 'get',
    global: false,
    async: false,
    data: {
      idvalue: pr_id
    },
    success: function(value) {
      return value;
    }
  }).responseText;
  console.log(JSON.parse(li));
}
render() {
  <div id="trans" onload=${()=>this.handleCall(this.id)}> // not working
    <p>Cal the ajax function without click button and pass id to ajax function</p>
  </div>
}
