Calling AJAX directly after page loads
It is a simple example how to call AJAX request right as page loads, not requiring user to do any action. This examples correctly handles both expected result and AJAX error and puts it into selected element.
Read More “Calling AJAX directly after page loads”