title: Loading video via jQuery makes page not functional
body: <p>I got this weird trouble with my jQuery code. The few lines that makes Youtube video load makes other functions disabled. I cant figure out what is happening.</p>
  
  <p>This function is causing it:</p>
  
  <pre><code>    function loadVideo(videoID) {
      alert(videoID);
  
    if(ytplayer) {
      ytplayer.loadVideoById(videoID);
    }
  }
  }
  </code></pre>
  
  <p>If I just //comment the part with ytplayer, the page starts working again.</p>
  
  <p>This is the whole code:</p>
  
  <pre><code> &lt;script type='text/javascript'&gt;
  function updateHTML(elmId, value) {
    document.getElementById(elmId).innerHTML = value;
  }
  
  function onPlayerError(errorCode) {
    alert("An error occured of type:" + errorCode);
  }
  
  function onYouTubePlayerReady(playerId) {
    ytplayer = document.getElementById("ytPlayer");
    ytplayer.addEventListener("onError", "onPlayerError");
  }
  
  function loadPlayer() {
    var videoID = "ylLzyHk54Z0"
    var params = { allowScriptAccess: "always" };
    var atts = { id: "ytPlayer" };
    swfobject.embedSWF("http://www.youtube.com/v/" + videoID + 
                       "?version=3&amp;enablejsapi=1&amp;playerapiid=player1", 
                       "videoDiv", "640", "360", "9", null, null, params, atts);
  }
  $(window).load(function(){
  function loadVideo(videoID) {
      alert(videoID);
  
    if(ytplayer) {
      ytplayer.loadVideoById(videoID);
    }
  }
  }
  
  function changeDescription(description){
      $('#descriptionBox p').text(description);
  }
  
  $(".videoLink").on("click", function () {
      var videoId = $(this).data('video'),
          description = $(this).data('description');
      loadVideo(videoID);
      changeDescription(description);
  
  });
  
  function _run() {
    loadPlayer();
  }
  google.setOnLoadCallback(_run);
  
  
  });
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I will be really glad if you could help me, I am looking way too long.</p>