title: Login with one button
body: <p>I have a <a href="http://cgi.di.uoa.gr/~std10093/login.php" rel="nofollow noreferrer">login</a> page, which will open the actual page (another url), if the password is correct.</p>
  
  <p>Here is the script I run:</p>
  
  <pre><code>&lt;script&gt;
   var dataGlobal;
   $('#in1').click(function(){
      var reply = prompt("Password", "");
      if(!reply) return; // user pressed cancel
      $.post('/~std10093/scheduler_pass.php', {elements: reply}, function(data) {
        if(data != "not")
          alert("Password ok, press the second button to enter scheduler");
        else
          alert("prits");
        dataGlobal = data;
      });
   });
   $('#in2').click(function(){
      window.open(dataGlobal);
   });
  &lt;/script&gt;
  </code></pre>
  
  <p>Now the user has to click the first button, give the password and then click the other button which will open the new url. I want to do this only with one button, is it possible?</p>
  
  <p>If I modify the code above and move <code>window.open(dataGlobal);</code> into the body of the <code>if(data != "not")</code> (which is the body that we will go into if the password is correct), firefox will prevent the new page from loading, since it prevents pop-up windows.</p>
  
  <p><img src="https://i.stack.imgur.com/7pYBE.png" alt="enter image description here"></p>
  
  <p>In the image above, one can see also the two buttons I was referring to previously.</p>
  
  <hr>
  
  <p>Ideally I would like to replace <code>window.open()</code> with something that will not trigger the prevention of a pop-up window.</p>
  
  <hr>
  
  <p>EDIT</p>
  
  <p>I want to have another url for the actual page. The actual page is the scheduler from <a href="https://gsamaras.wordpress.com/%CE%BA%CE%BB%CE%BF%CF%85%CE%B2%CE%B9/%CE%BA%CE%BB%CE%BF%CF%85%CE%B2%CE%AF-results/" rel="nofollow noreferrer">here</a>, which is public, thus the url of the login is public too. However, I want the url for the scheduler to be private, so that people I trust can access it without login.</p>