0
코드가 아직 작성되지 않은 경우 새 그룹을 추가하는 것이 좋습니다. 이제는 잘 작동하지만 그룹이 생기는 즉시 새 팝업 창을 열고 싶습니다. 만든, 초대장을 사용자에게 다른,하지만 난 내 작품을 작동하지 않는 것, 어떻게 작동하게하는 방법에 대한 아이디어?함수 내에서 팝업 창 만들기
<html>
<head>
<script type="text/javascript">
function addGroup()
{
x=document.getElementById("group").getElementsByTagName("p");
groups=document.getElementById("groupName");
var j=0,i=0;
if (groups.value=="")
{
alert('must create one group');
}
for (i=0;i<x.length;i++)
{
if (x[i].innerHTML == groups.value)
{
alert('the group name is already created');
return false;
}
}
if (!j)
{
var newNode=document.createElement('p');
var newString=document.createTextNode(groups.value);
newNode.appendChild(newString);
x[0].parentNode.appendChild(newNode);
newWindow();
}
}
function newWindow()
{
window.open('http://invite Others.html','invite
others','width=400,height=200,toolbar=yes,
location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes,
resizable=yes');
winObj.focus();
}
</script>
</head>
<body>
<div id="group">
<ul>
<p>Group03</p>
<p>Group02</p>
</ul>
</div>
<p><input type="text" id="groupName" size="84" maxlength="84" value=""/></p>
<p><input type="button" value="create" onclick="addGroup()" /></p>
<p><input type="button" value="remove" onclick="removeNo()"/> </p>
</body>
</html>
호스트 이름은 무엇을 의미합니까? "localhost"라는 단어를 삽입하는 것입니다. 나는 그것을 시도했지만 작동하지 않는 것 같습니다. 초대 된 others.html은이 파일과 동일한 디렉토리에 있습니다. 난 그냥 "others.html 초대"를 사용할 수 없지만 작동하지 않는 이유는 무엇입니까? sory new가 자바 스크립트 –
에 추가되었습니다. window.open ('newfile.html')을 사용하면 효과적입니다. 파일 경로의 HTTP 부분을 제거하거나 DNS 이름을 사용하십시오. 예 : http://www.google.com/myfile.js – Ballsacian1