Posted By

devnull69 on 07/08/11


Tagged

ajax document htmltocontext createDocument


Versions (?)

Ajax HTML to document


 / Published in: JavaScript
 

  1. function htmltocontext(source)
  2. {
  3. var dt = document.implementation.createDocumentType("html", "-//W3C//DTD HTML 4.01 Transitional//EN", "http://www.w3.org/TR/html4/loose.dtd");
  4. var doc = document.implementation.createDocument('','', dt);
  5. var html = doc.createElement('html');
  6. html.innerHTML = source;
  7. doc.appendChild(html);
  8. return doc;
  9. }

Report this snippet  

You need to login to post a comment.