title: How do I add a stylesheet to an iFrame from the parent, using javascript?
body: <p>my JSFiddle: <a href="http://jsfiddle.net/gCRuk/1/" rel="nofollow">http://jsfiddle.net/gCRuk/1/</a></p>
  
  <p>HTML: </p>
  
  <pre><code>My replays on SC-Replay.com:&lt;br&gt;
  &lt;iframe frameborder="0" name="frame" id="frame1" src="http://www.sc-replay.com/embedPlayer/21368-TheLindyHop.html" style="left: 0pt; position: relative; top: 0pt; width: 980px; height: 500px; border: 0px solid #00214E;" n="" vspace="0" marginheight="0" marginwidth="0" hspace="0" allowtransparency="true"&gt;&lt;/iframe&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>var ss = document.createElement("link");
  ss.type = "text/css";
  ss.rel = "stylesheet";
  ss.href = "http://www.lprestonsegoiii.com/WordPress/wp-content/themes/arjuna-x/style.css";
  
  var iframe;
  if(document.frames)
      iframe = document.frames["frame"];
  else
      iframe = window.frames["frame"];
  if(document.all)
      iframe.document.createStyleSheet(ss.href);
  else
      iframe.document.getElementsByTagName("head")[0].appendChild(ss);
  </code></pre>
  
  <p>I followed this guide: <a href="http://www.geekdaily.net/2007/09/19/javascript-adding-a-stylesheet-to-an-iframe/" rel="nofollow">http://www.geekdaily.net/2007/09/19/javascript-adding-a-stylesheet-to-an-iframe/</a></p>
  
  <p>And I'm not really sure what is happening here / what is going wrong.</p>