我是 html 编码的初学者,我想知道是否可以将窗口大小和其他属性直接写入页面。我解释一下。
我正在做一个计算,我想在我的桌面上运行 html 文件。一切正常,但它在打开其他选项卡的浏览器中启动。我希望它在一个没有状态栏、书签栏和固定窗口大小的小弹出窗口中运行。
编辑:
代码本身
<!doctype html>
<html>
<head><center>Kalkuraatur</center>
<Title>Javascripti Kalkulaator</title>
<script type="text/javascript">
if(window.name != "mypopup") {
window.open(document.location.href,'mypopup', 'left=300,top=200,width=200,height=200,toolbar=0,status=0,location=0,menubar=0,scrollbars=0,titlebar=0'); var child = window.open(...; child.focus();
window.close();
}
</script>
<script type="text/javascript">
function arvuta ()
{
kalku.sisend.value = eval(kalku.sisend.value)
}
function Bspace(sisend)
{
kalku.sisend.value = kalku.sisend.value.substring(0, kalku.sisend.value.length - 1)
}
</script>
</head>
<body>
<center>
<form name="kalku">
<table border=2>
<tr><td>
<input type="text" name="sisend" size="21">
<br>
</td></tr>
<tr><td>
<input type="button" name="seitse" value=" 7 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '7'">
<input type="button" name="kaheksa" value=" 8 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '8'">
<input type="button" name="yheksa" value=" 9 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '9'">
<input type="button" name="ykstagasi" value="del" style="height: 22px; width: 30px" onclick="Bspace(this)">
<input type="button" name="kustuta" value=" C " style="height: 22px; width: 30px" onclick="kalku.sisend.value = ''">
<br>
<input type="button" name="neli" value=" 4 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '4'">
<input type="button" name="viis" value=" 5 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '5'">
<input type="button" name="kuus" value=" 6 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '6'">
<input type="button" name="jaga" value=" ÷ " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '/'">
<input type="button" name="korruta" value=" x " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '*'">
<br>
<input type="button" name="yks" value=" 1 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '1'">
<input type="button" name="kaks" value=" 2 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '2'">
<input type="button" name="kolm" value=" 3 " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '3'">
<input type="button" name="lahuta" value=" - " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '-'">
<input type="button" name="plus" value=" + " style="height: 22px; width: 30px" onclick="kalku.sisend.value += '+'">
<br>
<input type="button" name="null" value=" 0 " style="height: 23px; width: 64px" onclick="kalku.sisend.value += '0'">
<input type="button" name="koma" value=" , " style="height: 22px; width: 30px" onclick="kalku.sisend.value += ','">
<input type="button" name="v6rdub" value=" = " style="height: 22px; width: 64px" onclick="arvuta ()">
</td></tr>
</form>
</center>
</body>
</html>