我一直在html編碼的初學者,我想知道如果我可以直接寫入窗口大小和其他屬性到頁面。 Il解釋。從桌面打開文件到一個彈出窗口
我正在使用calc,我想在桌面上運行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>
你將不得不求助於JavaScript。嘗試http://www.textfixer.com/html/javascript-pop-up-window.php,看看是否有幫助。 –
calc是什麼意思? –
Calc爲計算器,文件不會上傳到任何位置。它在我的電腦裏。 – Jakwobo