title: create dynamic frameset and frame with javascript
body: <p>I've a problem with a dynamic creation of frameset and frame, I'm write these simple script:</p>
  
  <pre><code>        function createframe(){ 
          var ahead = document.head;
          var mainfs = document.createElement('FRAMESET');
          mainfs.setAttribute("name", "mainframeset");
          mainfs.setAttribute("id", "mfs");
          mainfs.setAttribute("cols", "50,*");
          ahead.appendChild(mainfs);
          for ( var i = 0; i &lt; 2; i++) {
            var ifrm = document.createElement("IFRAME"); 
            ifrm.setAttribute("src", "www.facebook.it"); 
            document.getElementById('mfs').appendChild(ifrm);
  } 
  </code></pre>
  
  <p>And put in head of blank html page, but won't work!</p>
  
  <p>any suggestion?</p>