Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
How to make a javascript function wait for a javascript function to execute?

Hi,

I have this function on jquery:

<script type="text/javascript">
   // jQuery Document
   $(document).ready(function () {
    function loadlog() {
     $.get("logs.html', function (data) {
      $("#container").html(data);
     });
    }
   
    loadlog(); 
   });
  
  //start javascript
  var whatever= something;
</script>

I want the javascript part to start right AFTER loadlog(); has finished loading all its stuff so #container wont be empty. Most of the time it does but seems like it will often takes too long in reading the external file and it loads it after the javascript part executes I dont want. What can I do?

Thank you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!