弹出相关问题

There is a button in my webpage which calls another page through AJAX.The page carries certain data named "Match" if the query is successfully ran. Now I want that if a Match is recieved from the other page then a pop up comes. Here's my code

<div id="myNav" class="overlay">
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">&times;</a>
<div class="overlay-content">
<h>ksadjaskjdaskdjaskdjaskdjaskdjaskdjasdk</h>  </div>
</div>
<button class="abc" style="font-size:30px;cursor:pointer" >&#9776; Accept</button>

 <script type="text/javascript">
 var a="Match";

    $(document).ready(function(){
    $(".abc").click(function(){

        $.ajax({
            type: 'POST',
            url: 'accept.php?w1=<?php echo $id ?>',
            success: function(data) {

               // $("p").text(data);
             if(a=data)
             {
               function openNav()
                {
                  document.getElementById("myNav").style.height = "100%";
                }
             }
             else
             {
               location.reload();         
             }
          }              

        });
      });
     });


  function closeNav() {
  document.getElementById("myNav").style.height = "0%";
   }