런타임시 내 Xul 응용 프로그램에 스크립트를 추가하려고합니다.런타임에 스크립트를 추가하는 방법은 무엇입니까? (document.write는 함수가 아닙니다)
document.write('<script type="text/javascript" src="chrome://myapp/content/myscript.js"/>');
Error: document.write is not a function
함수가 in the docs로 존재합니다.
document.open();
document.write("<h1>Out with the old - in with the new!</h1>");
document.close();
그러나 나는 다음과 같이 나타났습니다.
document.open is not a function
어떤 아이디어가 잘못된 것입니까?
- 갱신
아마 javacript 모듈에 js 코드를 넣고 Components.utils.import으로 가져올 수 있습니다 (리소스를 넣을 위치와 참조 방법 찾기)
'문서'를 다시 정의하는 범위 수준의 코드에 무엇이 있습니까? 예를 들어, 실제 '문서'변수를 숨기는 로컬 변수입니까? – Tejs
@Tejs 아니, 아니 어디. 문서가 원래 문서입니다. –