I have the following javascript code, I redirect old link to a new one dynamically.
Sometimes newLink does not exist, and instead of getting 404 page, I want to custom my own page if URL was not found.
Any idea how to add this condition in my code please ?
<script>
setTimeout(function(){
$('a[href="oldLink"]').attr('href','dir/newLink)
}, 1000);
</script>
Thanks !
Aucun commentaire:
Enregistrer un commentaire