I have a question about implementing an AJAX request in my code. Currently, I have the text on the screen updating when a dropdown input is selected using 'onchange'. However, I also want this same behavior to occur on page load, but I am struggling to find the correct syntax.
$(document).on('change','#standalone-invoice-billpayer', function (evt) {
updateCardDetailsText(evt)
});
Currently, clicking on the dropdown triggers the function with the AJAX request, which works perfectly. But now I want this same functionality to happen automatically on page load. I am working with Ruby on Rails and would appreciate any assistance or guidance. Thank you!