function ajaxDeleteDoc(link, replaceID, notice) { if(confirm(notice)) { $.get(link, function(data) { location.href = JSON.parse(data).locate; }) } }