The following code loads JSON data into Tabulator when a button is clicked. How do I get rid of the button logic and trigger the setData function when the page loads?
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://unpkg.com/tabulator-tables/dist/css/tabulator.min.css" rel="stylesheet">
<script type="text/javascript" src="https://unpkg.com/tabulator-tables/dist/js/tabulator.min.js"></script>
</head>
<body>
<div>
<button id="ajax-trigger">Load Data via AJAX</button>
</div>
<div id="example-table"></div>
<script type="text/javascript">
var table = new Tabulator("#example-table", {
columns:[
{title:"playerName", field:"playerName"},
{title:"siVenue", field:"siVenue"},
{title:"hrValue", field:"hrValue"},
{title:"xbhValue", field:"xbhValue"},
{title:"baseValue", field:"baseValue"},
],
});
document.getElementById("ajax-trigger").addEventListener("click", function(){
table.setData("https://example.com/getData.php");
});
</script>
</body>
</html>