title: Javascript Document.write another script
body: <p>so I am trying to use document.write to write anohter script to the document. Here is my code for the function:</p>
  
  <pre><code>    function onSaveOk(streamName,streamDuration,userId,cameraName,micName,recorderId){
          //alert("onSaveOk("+streamName+","+streamDuration+","+userId+","+cameraName+","+micName+")");
  
          //the user pressed the [save] button inside the recorder and the save_video_to_db.XXX script returned save=ok
          //recorderId: the recorderId sent via flash vars, to be used when there are many recorders on the same web page
  
  
              $('#record').hide();
  
  document.write('"&lt;d"+"iv id=jwplayer&gt;"
  + "&lt;cen"+"ter&gt;" +
  "&lt;d"+"iv id=mediaplayer&gt;"+"&lt;/di"+"v&gt;"+
  "&lt;scr"+"ipt type=text/javascript&gt;
    jwplayer('mediaplayer').setup({
      'flashplayer': 'jwplayer/player.swf',
      'id': 'playerID',
      'width': '640',
      'height': '580',
      'provider': 'rtmp',
      'streamer': 'rtmp://domain/recorder/_definst_',
      'file': 'onSaveOk("+streamName+")'
    }); " +
  "&lt;/scr"+"ipt&gt;"+
  "&lt;/cen"+"ter&gt;"
  ')
  </code></pre>
  
  <p>Basically what happens is the recorder that was suposed to show up simply does not show up. When I have this in my function, for some reason  <code>$('#record').hide();</code> doesnt work eiether...</p>