jquery pass param to onload function

function test(params) {

        (function(params){//this is a closure which we use to ensure each iteration has the right version of the variable 'params'

            reader.onload = function(e) {
                console.log(params);//can access from outside :D
        })(params);// pass in the current params to the closure so that it can be used within


Related posts:

This entry was posted in jquery. Bookmark the permalink.