는 사용자 지정 문서 객체를 생성 : 거기에 쓸 수사용자 정의 문서 객체에 document.write가없는 이유는 무엇입니까?
var doc = document.implementation.createDocument(
'http://www.w3.org/1999/xhtml',
'html',
//Inherit current doctype
document.doctype
);
시도 :
//Throws error - TypeError: doc.write is not a function
doc.write(document.documentElement.innerHTML);
같은 .close
및 .open
도 마찬가지입니다. 도대체 뭐야? 이거 버그 야? 아마 아닐 - 모든 브라우저가 그것을 :
크롬 :
Uncaught TypeError: undefined is not a function
오페라 :
TypeError: Object #<Document> has no method 'write'
파이어 폭스 :
TypeError: document.implementation.createDocument(...).write is not a function
왜 사용자 정의 문서에 대해 open
, write
및 close
이 누락 되었습니까?
'.write','.open' 및'.close'는 끔찍한 방법이고 사용하면 안되기 때문에 제 추측이 될 것 같습니까? –
실제로 그'doc'로 무엇을하려합니까? – Cerbrus
@NiettheDarkAbsol 왜 그들은 끔찍한가요? 전체 문제에 대해 더 나은 해결책을 제안합니까? –