Pop Under JavaScript Code – Copy and Paste
Here’s the code I found years ago that still works today (from Chris Carter):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Page 1</title>
</head>
<body>
<p>This is page 1 </p>
<p>This is a <a href="https://www.tonyherman.com/">link</a></p>
<!-- Stuff that makes the javascript run - @MercenaryCarter -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('a').click(function(e) {
var id = $(this).data("windowid");
if(id == null || id.closed) {
id = window.open($(this).attr("href"), '_blank');
}
id.focus();
$(this).data("windowid", id);
e.preventDefault();
setTimeout(function () {
window.location.href = "http://yahoo.com/"; //will redirect to your landing page.
}, 1000); //will call the function after 1000 millisecond. (1000 = 1 second)
return false;
});
});
</script>
<!-- Stuff that makes the javascript run - @MercenaryCarter -->
</body>
</html>
Do not use this on a website that has Google AdSense running on it.
📄 Download a PDF of This Article
