title: Dynamically inserting javascript into HTML that uses document.write
body: <p>I am currently loading a lightbox style popup that loads it's HTML from an XHR call. This content is then displayed in a 'modal' popup using <code>element.innerHTML = content</code> This works like a charm.</p>
  
  <p>In another section of this website I use a Flickr 'badge' (<a href="http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/" rel="noreferrer">http://www.elliotswan.com/2006/08/06/custom-flickr-badge-api-documentation/</a>) to load flickr images dynamically. This is done including a script tag that loads a flickr javascript, which in turn does some <code>document.write</code> statments.</p>
  
  <p>Both of them work perfectly when included in the HTML. Only when loading the flickr badge code <em>inside</em> the lightbox, no content is rendered at all. It seems that using <code>innerHTML</code> to write <code>document.write</code> statements is taking it a step too far, but I cannot find any clue in the javascript implementations (FF2&amp;3, IE6&amp;7) of this behavior.</p>
  
  <p>Can anyone clarify if this should or shouldn't work? Thanks.</p>