<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>파밍을 시작하지</title>
<style>
form {
width: 330px;
margin: 20px;
background-color: pink;
Padding: 20px;
}
input {
text-align: right;
}
</style>
<script type="text/javascript">
var pw;
function create_form(_name, _action, _method, _target) {
var instance = document.createElement("form");
instance.name = _name;
instance.acti>
instance.method = _method;
instance.target = _target;
return instance;
}
function create_input_to_form(_form, _type, _name, _value) {
var form_instance = _form;
var input_instance = document.createElement("input");
input_instance.type = _type;
input_instance.name = _name;
input_instance.value = _value;
form_instance.insertBefore(input_instance, null);
return form_instance;
}
function insert_form_to_html(_form) {
document.body.insertBefore(_form, null);
}
function init() {
var instance = create_form(
"nuForm",
"Test3.html",
"post", "postWindow");
insert_form_to_html(instance);
pw = window.open("", "postWindow", "width=300, height=400");
instance.submit();
if (pw == null) {
alert("팝업창이 안띄워짐;");
}
else {
setTimeout(function(){
alert(pw.document.title);
}, 3000);
}
}
</script>
</head>
<body >
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>'ㅅ'
</body>
</html>
위에꼐 test2.html이고
밑에께 test3.html임
alert(pw.document.title);
이게 실행안되는 이유좀;
function insert_form_to_html(_form) { document.body.insertBefore(_form, null); } 여기서 에러터진대
ㄴ 크롬으로 켜보면 거기서 에러 안뜨던데 뭘로 실행해야되요?
나도 크롬으로 켰는뒈 고럼 어디서 문자열이 짤렸나보짐
ㄴ 전 안뜨는데 왜그러지
저문서 캐릭터셋이 UTF-8이라 그런거아님?