I am trying to implement the one scenario like when dashboard widget is over the loaded in document, then only I want call particular data by ajax call how to implement this in jQuery any one can you please help on it am not getting idea about it.
note: actually what i am getting data by API through ajax call I want load that services/data only after complete loading of dashboard widgets
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.6.1.js" integrity="sha256-3zlB5s2uwoUzrXK3BT7AX3FyvojsraNFxCc2vC/7pNI=" crossorigin="anonymous"></script>
</head>
<body>
<div>This Dashobard/Index page</div>
<div>Dashboard Widgets are loaded</div>
<script>
$( window ).on( "load", function() {
$.ajax({
url:"/farmers/updateTaskAssignment",
type:"GET",
success: function(resp){
console.log(resp);
},
error:function(error){
console.log(error);
}
})
console.log( "window loaded" );
});
</script>
</body>
</html>