±æÀÌ¿¡ ÀÇÇÑ, ±æÀ̸¸À» À§ÇÑ, ±æÀÌÀÇ °è»êÀÚ¹Ù½ºÅ©¸³Æ®!!
´Ùü·Î¿î ±æÀÌ ¹× °Å¸®´ÜÀ§¸¦ °£´ÜÇÏ°Ô °è»êÇÒ¼ö ÀÖ´Â °è»ê½Ä ÀÚ¹Ù½ºÅ©¸³Æ®ÀÔ´Ï´Ù.
¾Æ·¡´Â ÀÚ¹Ù½ºÅ©¸³Æ®ÀÇ ¿ø¹®ÀÔ´Ï´Ù.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript">
var factors1 = new Array(1, 0.01, 0.00001, 0.00000621, 0.3937, 0.0328, 0.01094);
var factors2 = new Array(100, 1, 0.001, 0.000621, 39.37, 3.28, 1.094);
var factors3 = new Array(100000, 1000, 1, 0.621, 39370, 3280, 1094);
var factors4 = new Array(160934, 1609.34, 1.60934, 1, 63360, 5280,1760);
var factors5 = new Array(2.54, 0.0254, 0.0000254, 0.0000158, 1, 0.08333, 0.02778);
var factors6 = new Array(30.48, 0.3048, 0.0003048, 0.0001896, 12, 1, 0.3333);
var factors7 = new Array(91.44, 0.9144, 0.0009144, 0.0005688, 36, 3, 1);
var factors = new Array(factors1,factors2,factors3,factors4,factors5,factors6,factors7);
function convert_unit()
{
from_index = document.length_con.from_unit.selectedIndex;
to_index = document.length_con.to_unit.selectedIndex;
factor = factors[from_index][to_index];
document.getElementById("formula").innerHTML = document.length_con.from_unit.options[document.length_con.from_unit.selectedIndex].text + " = " + factor + " " + document.length_con.to_unit.options[document.length_con.to_unit.selectedIndex].text;
if(isNaN(document.length_con.from_value.value))
document.getElementById("to_value").innerHTML = "Not a valid number.";
else
document.getElementById("to_value").innerHTML = factor * document.length_con.from_value.value;
}
</script>
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<form name="length_con">
<table>
<tr>
<td>From </td>
<td>
<select name=from_unit onChange="convert_unit()";>
<option> ¼¾Æ¼¹ÌÅÍ</option>
<option> ¹ÌÅÍ</option>
<option> ų·Î¹ÌÅÍ</option>
<option> ¸¶ÀÏ</option>
<option> ÀÎÄ¡</option>
<option> ÇÇÆ®</option>
<option> ¾ßµå</option>
</select>
</td>
<td> To </td>
<td>
<select name=to_unit onChange="convert_unit()";>
<option> ¼¾Æ¼¹ÌÅÍ</option>
<option> ¹ÌÅÍ</option>
<option> ų·Î¹ÌÅÍ</option>
<option> ¸¶ÀÏ</option>
<option> ÀÎÄ¡</option>
<option> ÇÇÆ®</option>
<option> ¾ßµå</option>
</select>
</td>
</tr>
<tr>
<td> </td><td colspan="3"><div id="formula">¼¾Æ¼¹ÌÅÍ = 1 ¼¾Æ¼¹ÌÅÍ</div></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td>Enter </td>
<td><input type="text" name="from_value" value="1" size="12" maxlength="12"></td>
<td> <input type=button value="=" onClick="convert_unit()";> </td>
<td><div id="to_value">1</div></td>
</tr>
</table>
</form>
</body>
</html>
|