title: AJAX and YouTube: 'X-Frame-Options' to 'SAMEORIGIN'.
body: <p>I'm writing a site where content is loaded dynamically via jQuery.  The reason for this is to leave an audio player running while being able to navigate through page content without refresh.</p>
  
  <p>Ran into trouble trying to get YouTube videos to work, it's setup like this.</p>
  
  <p>Site content is loaded using .load(), and for the videos page it contains an unordered list of links to YouTube videos, and each with an empty <code>&lt;div&gt;</code> for <code>&lt;iframe&gt;</code>'s.  Clicking on a link grows the <code>&lt;li&gt;</code> and embeds the <code>&lt;iframe&gt;</code> with the video.</p>
  
  <p>Everything works well except the <code>&lt;iframe&gt;</code> will not load the source, throwing this error.</p>
  
  <p><strong>Refused to display '<a href="http://www.youtube.com/watch?v=myvideo" rel="noreferrer">http://www.youtube.com/watch?v=myvideo</a>' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.</strong> </p>
  
  <p>Also tried adding <code>&lt;iframe&gt;</code> into <code>&lt;li&gt;</code> with <code>display: none;</code> with same result.</p>
  
  <p>I thought I understood the javascript same domain policy, but this is beyond me.  Googling the error leads me to believe it's something server side?  But that doesn't make any sense.</p>
  
  <p>Hard to fiddle something like this, hope it makes sense.</p>