Friday, June 5, 2009

[jQuery] Re: How to check if an element is done loading

<script>

$function() {

$("#myelementid").load(function() {

alert("my element is fully loaded");

});

});
</script>



On Fri, Jun 5, 2009 at 2:35 PM, Jeff Rose <carrie.n.jeff@gmail.com> wrote:

I'm looking for suggestions on how I can implement the following using
jQuery 1.3 and whatever plugins may help.

I need to insert an iframe or img that links to an external resource
onto a page, and if that iframe or img does not load within a certain
period of time, remove it and insert one that links to a local
resource instead.

My only hang-up is I'm not sure how to check if the iframe or img is
done loading.

Any help would be greatly appreciated.

-Jeff

No comments: