Search Results

Search found 32 results on 2 pages for 'codeninja'.

Page 2/2 | < Previous Page | 1 2 

  • How do you make the script wait for the status of an Ajax get request before continuing?

    - by codeninja
    Basically what I'm doing is checking for the existence of an object, if it's not found, the script will try to load the source file using getScript. I only want to check this once though then return true or false to the function that calls fetch() fetch:function(obj){ ... isReady = false; $.getScript(obj.srcFile,function(){ isReady=true; warn("was able to load object "+key); }); return isReady; } but return kicks in before the script loads =/ later the script is loaded but the function returned false. This is the beauty of asynchronous I suppose... What's the best way to handle this... Maybe I could check again at some other point if the object exists? Or maybe there's a better way to do this where I dont have to potentially lock the browser?

    Read the article

  • How can you check if a file exists before including/importing it in JSP?

    - by codeninja
    Assuming that requestScope.importMe is expecting a path to a jsp file <c:choose> <c:when test="${!empty requestScope.importMe && fileExists(requestScope.importMe) }"> <c:import url="${requestScope.importMe}" /> ... How can I check if the file exists before trying to include it so that an error is not thrown? I'd like to avoid using inline Java. Something using one of the JSTL tags is the preferred approach.

    Read the article

< Previous Page | 1 2