Ejemplos en Javascript

Varios conversores en uno

<HTML>
<HEAD>

<TITLE>Ejemplos Javascript: ejemplo pr???¡ctico </TITLE>

<!*************************************************************************
  *-----------------------------------------------------------------------*
  *-- Created By : Jamie Beyore  . . .   July 19, 1997 . . . 3:31:22 pm --*

  *--------------------- All Rights Reserved (R)--------------------------*
  *-----------------------------------------------------------------------*
  *************************************************************************
//--->

<SCRIPT LANGUAGE="JavaScript">

<!--- hide script from old browsers

function hullspeed(form) {form.result1.value = (Math.sqrt(form.lwl.value *
1)) * (1.34 * 1)
                                  form.unit.value = "Knots"}

function wavespeed(form) {form.result1.value = (1.34 * 1) *
(Math.sqrt(form.wvspd.value * 1))
                                  form.unit.value = "Knots"}

function miles(form) {form.result1.value = (form.mile.value * 1) * (0.86898
* 1)
                            form.unit.value = "Nautical Miles"}

function km_kn(form) {form.result1.value = (form.kilo.value * 1) * (0.53966
* 1)
                            form.unit.value = "Knots/hour"}
                       
function kn_km(form) {form.result1.value = (form.knots.value * 1) *
(1.85200 * 1)
                            form.unit.value = "Kilometres/hour"}

function kn_ft(form) {form.result1.value = (form.feet.value * 1) *
(101.3000 * 1)
                            form.unit.value = "Feet/min"}

function display (textfield)

{

alert(". . . . . . . . . . . . . . About Nautical Calucaltor . . . . . . . . . . . . . .                This Script Was Created By: Jamie Beyore July 19, 1997 . . . 1997 (C)")

}

// end hiding contents from old browsers  -->

</SCRIPT>



</HEAD>

<BODY bgcolor="white">

<TABLE BORDER=2 WIDTH=340>
<FORM>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Enter Your LWL : </TH>
<TH BGCOLOR="yellow" WIDTH=45%><INPUT TYPE="text" NAME="lwl" SIZE=5></TH>
<TH BGCOLOR="red" WIDTH=10%><INPUT TYPE="BUTTON" VALUE="Calculate Your HullSpeed" ONCLICK="hullspeed(this.form)">
</TR>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Enter The Wave Length : </TH>
<TH BGCOLOR="yellow"WIDTH=45%><INPUT TYPE="text" NAME="wvspd" size=5></TH>
<TH BGCOLOR="yellow" WIDTH=10%><INPUT TYPE="BUTTON" VALUE="Calculate Wave Speed"
ONCLICK="wavespeed(this.form)">
</TR>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Enter The Miles : </TH>
<TH BGCOLOR="yellow"WIDTH=45%><INPUT TYPE="text" NAME="mile" size=5>
<TH BGCOLOR="red"WIDTH=10%><INPUT TYPE="button" VALUE="Convert Miles To Nautical
Miles" ONCLICK="miles(this.form)">
</TR>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Enter The Kilometers : </TH>
<TH BGCOLOR="yellow"WIDTH=45%><INPUT TYPE="text" name="kilo" size=5>
<TH BGCOLOR="red"WIDTH=10%><INPUT TYPE="button" Value="Convert Km/h to Knots/h"
ONCLICK="km_kn(this.form)">
</TR>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Enter The Knots Value : </TH>
<TH BGCOLOR="yellow"WIDTH=45%><INPUT TYPE="text" name="knots" size=5>
<TH BGCOLOR="red"WIDTH=10%><INPUT TYPE="button" Value="Convert Knots/h to Km/h"
ONCLICK="kn_km(this.form)">
</TR>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Enter The Knots Value : </TH>
<TH BGCOLOR="yellow"WIDTH=45%><INPUT TYPE="text" name="feet" size=5><TH BGCOLOR="red"WIDTH=10%><INPUT TYPE="button" Value="Converts Knots/min to
Feet/min" ONCLICK="kn_ft(this.form)">
</TR>
<TR>
<TH BGCOLOR="yellow" WIDTH=45%>Results: <INPUT TYPE="text" Name="result1"size=2>
<INPUT TYPE="text" Name="unit" size=8></TH>
<TH BGCOLOR="yellow"WIDTH=45%><INPUT TYPE="RESET" VALUE="Clear"></TH>
<TH BGCOLOR="lightblue"WIDTH=10%><INPUT TYPE="button" Value="About"
ONCLICK="display(this)"></TH>
</TR>
</FORM>
</TABLE>
</left>


</body>
</html>

Conversores