JSFiddle - React, Tailwind, and code Playground

by Angelos Chaidas

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<html>
<head>
    <meta charset="UTF-8">
    <title>Redirection tests</title>
</head>
<body>
    <h1>
        Welcome to the Adzuna interstitial!
    </h1>
    <p>I will now try to programmatically open a new tab...</p>
    <p>However, if we do the same as a result of a user interaction (like e.g. a click):</p>
    <p><button id="tap">Tap me!</button></p>
</body>
</html>

JavaScript

$(function() {
  var newTab = window.open("https://www.adzuna.co.uk");
  if (!newTab) {
    alert("I could not open a new tab");
  }
  $("#tap").on("click", e => {
    window.open("https://www.adzuna.co.uk");
  });
});