I have this in my jQuery:
$(document).on('click', '.upload-wrap', function(event)
{
$('[name="uploads[]"]').trigger('click');
});
but it returns 'too much recursion' error! however it doesn't for my other elements like:
$(document).on('click', '.upload-image-wrap', function(event)
{
$(this).next('[name="image"]').trigger('click');
});
I have used setTimeout either to fix this:
$(document).on('click', '.upload-wrap', function(event)
{
setTimeout(function() {
$('[name="uploads[]"]').trigger('click');
}, 0);
});
But now firefox shows top of the page that 'Firefox prevented this site from opening 99999999 pop-up windows' in which 99999999 is increasing by miliseconds.
How can I fix it?
Thanks