How to create AJAX on page load call into a javascript function

i am doing a project
I was wondering if anyone know how to do AJAX on page load
i got a json format with some x and y coordinates and img icon to the each place data
how shld i use AJAX to call the json format data to the javascript function where i put the point of each place
So how to call the point when page load using the xmlhttprequest in ajax