Call A Function Again, Recusive, With The Same Parms

Call A Function Again, Recusive, With The Same Parms

I am running into a bit of a problem. Is there a way in JavaScript or jQuery to basically say call yourself (a function) again, with the exact same parameters that were passed into you (function). Basically I need this for a recursive function to stick into a setTimeout().

Below is the code.

function recursive_wait_for_content(p_Div, p_JavaScriptPath) {
   ////
   // Continue waiting, because the div has no content
   ////
   if(p_Div.html() == '') {
      setTimeout({MAGIC_CALL_YOURSELF_AGAIN_HERE}, 250);
   }
   ////
   // There is content in the div, load dynamic javascript
   ////
   else {
      $.getScript(p_JavaScriptPath);      
   }   
}


Thanks.
    • Topic Participants

    • info