0
나는 매우 이상한 행동을 받고 있어요 :(나는 누군가가 문서와 자바 스크립트 파일을 받고 XMLHTTP 요청 메신저를 사용자바 스크립트 .. document.write를 .. 이상한 문서 동작 '(
을 도울 수 있기를 바랍니다 그것과 물품. .이 같은 같습니다 내가 doc.getElementsByTagName('input');
을 얻을 때 지금
document.write("<input type='hidden' name='orange' value='17' />");
document.write("<input type='hidden' name='apple' value='29' />");
나는 기본적으로 iframe 내에있는 형태로 그 입력 요소를 추가 할
// i get the document of the iframe
var docc = doc.getElementById("rs-iframe").contentDocument;
var body = docc.getElementsByTagName('body')[0];
// i put the response from xmlhttprequest in a script tag
var script = docc.createElement('script');
script.type = "text/javascript";
script.text = "//<![CDATA["+xmlhttp.responseText+"//]]>";
// i get the position where i want to put my script tag
var elem = form.getElementsByTagName('script')[6];
// i try to insert my script tag from xmlhttprequest before the script i retrieve from the form
elem.parentNode.insertBefore(script, elem);
// the i append the form to the body of the iframe document
body.appendChild(form);
를 내가 document.write에서 추가 된 요소 만 가져오고 다른 폼 요소는 사라졌습니다. (
감사합니다.