I wrote this script to pop up a confirm dialog when a user clicks on any link external from our site. It performs as expected on our internet site, however when I try to run this script on our FAQ portal, it does absolutely nothing. I believe it is blocking jQuery from running. What would be your recommendation to converting this script to javascript?
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
$(function(){
$('a').click(function(){
if ((this.href.toLowerCase().indexOf("myfloridalicense.custhelp") > -1) ||
(this.href.toLowerCase().indexOf("myfloridalicense") > -1) ||
(this.href.toLowerCase().indexOf("javascript") > -1) ||
(this.href.toLowerCase().indexOf("dbprftp") > -1) ||
(this.href.toLowerCase().indexOf("interredesignalpha") > -1) ||
(this.href.toLowerCase().indexOf("bpr") > -1))
{
//Throw away
}
else {
if (window.confirm('NOTICE: By accessing this link, you will be leaving the DBPR website. DBPR is not responsible for the content of the Internet website you are entering. DBPR neither warrants nor makes any representations nor endorsements as to the accuracy, quality, content or completeness of the information, text, images, graphics, hyperlinks, and other items contained on the Internet website you are entering. DBPR is not responsible or liable for any viruses or contaminations of your hardware, software, peripherals or property, resulting from use of the Internet websites linked to or from the DBPR Internet website. Do you want to proceed?'))
{
// They clicked Yes
}
else
{
// They clicked no
return false;
}
}
});
});
</script>
Thanks in advance for your help!