0
私はこのコードを使用して、サードパーティのサイトに行くことをユーザーに通知していますが、外部の一部のURLを除外したいと考えています。どのようにしてこのコードでそれを行うことができますか?一部の外部リンクをこの通知の受信から除外する必要があります
<script>
$('a').each(function() {
if (this.href !== "#" && this.href.indexOf('/') !== 0 && this.href.indexOf(location.hostname) === -1) {
$(this).attr('target', '_blank')
.click(function() { return confirm('NOTICE: You are leaving our website and will enter a website maintained by a third party. We are providing a link to the third party website solely as a convenience to you, because we believe that website may provide useful content. We are not, by referring or linking to the third party website, incorporating its contents into our own website. We do not endorse or guarantee, and we disclaim any responsibility for: the content, products or services offered on that website, its performance or interaction with your computer, its security and privacy policies and practices, and any consequences that may result from visiting that website. By clicking OK, you acknowledge this statement.');
});
}
});
});
</script>
私は、私は通知から除外されたいURLと上記のstackflow.comを交換し、これに前のコードのすべてを置き換えるが、それはのために働いていません私。今は通知なしですべてが開かれています。試していただきありがとうございます! – TDB
@TDBコードサンプルに小さな問題がありました。 – Brian
完了!とてもありがとう! – TDB