I have a very similar requirement specified here.
I need to have the user\'s browser start a download manually when $(\'a#someID\').click();
$(\'a#someID\').click();
But
Excelent solution from Corbacho, I just adapted to get rid o the var
function downloadURL(url) { if( $('#idown').length ){ $('#idown').attr('src',url); }else{ $('', { id:'idown', src:url }).hide().appendTo('body'); } }