PHP and JQuery To Delay The Loading Of A Function that makes API Calls

Job ID: 35606242

Budget: ₹600 – ₹1,500 INR

I need someone who can fix my PHP code to delay a function.
The function calls an API that is very slow. Due to this, the page loads slowly.
I want to load the page with other elements and then load the function for API calls later. In the meantime a placeholder like loading can be used.

It should be roughly 1-hour work if you know what you are doing.
The application is a one-pager search page that takes search terms from users and returns results
Related categories: PHP AJAX jQuery / Prototype