I am using jquery file upload function on my page like following:
$('.new-variant-image')
.fileupload({
dataType: 'script',
add: function(e, data){
}
});
but the DOM class "new-variant-image" is dynamically created after the page is loaded, so it wouldn't work. I searched ways to bind dynamic event using "on" and "live" but wouldn't get it to work in this case.
Any assistance will be much thanked.
Edit
The DOM element "new-variant-image" is created afterwards using AJAX, it works if I put the code after the element is created. BUT I want to avoid that, because when I call the function using ajax multiple times it cause the browser to hang about 2 to 3 seconds.