Using JavaScript, I am integrating content from a PHP file on a different server. Unfortunately, this external service can be unreliable at times, causing delays in loading or not loading at all.
I am looking for a way in JavaScript to attempt retrieving the external data for a specific duration before deciding to stop including the JavaScript content.