How to stop Ajax image load calling a new function ?
I'm doing something like this ->

    $("<img>").attr("src", "path/to/image.jpg").load(function(){
    	$("#thediv").append(this);
    });

so i can append the new image when the image is completely loaded

I have a timer to call this function with new parameters every 6 seconds.... but I want to call a function to load a new set of images but I have this old set running in background ( asynchronous ) and i need to stop that load so the image won't append beacuse i don't want that image  and I'm trying to load a whole new different set of images... I was thinking on something like :

    function loadNewSet(){
       window.stop(); // i don't quite know if this exist or works but 
                     //should stop all ajax request taking place at that time
       loadImages(); // call some function to load the new set
    }
How to stop Ajax image load calling a new function ?
===

I'm doing something like this ->

    $("<img>").attr("src", "path/to/image.jpg").load(function(){
    	$("#thediv").append(this);
    });

so i can append the new image when the image is completely loaded

I have a timer to call this function with new parameters every 6 seconds.... but I want to call a function to load a new set of images but I have this old set running in background ( asynchronous ) and i need to stop that load so the image won't append beacuse i don't want that image  and I'm trying to load a whole new different set of images... I was thinking on something like :

    function loadNewSet(){
       window.stop(); // i don't quite know if this exist or works but 
                     //should stop all ajax request taking place at that time
       loadImages(); // call some function to load the new set
    }