salve ho fatto questo script per permettere all cms SMF che qualdo qualcuno clicca l'allegato apre un altro sito
tale però ha portato ad un bug ovvero se metot due o più allegati insieme nello stesso topic e provo a scaricarli scarica il primo... se scarico il secondo scarica il primo e cosi via scarica il primo anche se sono 20 allegati
questo e il codice
come risolvo?
codice:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$(".attachments").find("a").each(function () {
$(this).data('dummy_href', $(this).attr('href'));
$(this).attr('href', '#');
the_link = $(this);
$(this).click(function () {
setTimeout(function() {
window.location = the_link.data('dummy_href');
}, 3000);
window.open('https://github.com/Spuds', 'window name', 'window settings');
return false;
});
});
});
</script>