title: Pause Youtube Video Javascript Refreshes Page
body: <p>In my code I tried pausing the youtube video by using Javascript. I took this question (below) as a reference, and it works great.</p>
  
  <p><a href="https://stackoverflow.com/questions/8667882/how-to-pause-a-youtube-player-when-hiding-the-iframe/8668741#8668741">How to pause a YouTube player when hiding the iframe?</a></p>
  
  <p>The problem is that it is refreshing my website. I'm not exactly sure as to why that is or if there is any sort of workaround... This is my code... I'm using an AjaxModalPopupExtender to hide/show my div. </p>
  
  <pre><code>        function ShowModalVideo() {
              var Popup = $find("&lt;%=mpeVideo.ClientID%&gt;");
              if (Popup) {
                  Popup.show();
              }
              return false;
          }
  
          function HideModalVideo() {
              var Popup = $find("&lt;%=mpeVideo.ClientID%&gt;");
              if (Popup) {
                  Popup.hide();
                  var iframe = document.getElementById("youtube");
                  iframe.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
  
              }
              return false;
          }
  </code></pre>
  
  <p>I'd really appreciate any help or insight on the matter.</p>