t.firstChild
  && iframe.contentDocument.firstChild.nodeType != Node.DOCUMENT_TYPE_NODE) {
    iframe.contentDocument.removeChild(iframe.contentDocument.firstChild);
  }

  while (iframe.contentDocument.lastChild
  && iframe.contentDocument.lastChild.nodeType != Node.DOCUMENT_TYPE_NODE) {
    iframe.contentDocument.removeChild(iframe.contentDocument.lastChild);
  }

  if (!iframe.contentDocument.firstChild) {
    // This will throw an exception in Opera if we reach here, which is why
    // I try to avoid i