时间/距离转换器帮助(ptII) [英] Time/distance converter help (ptII)

查看:77
本文介绍了时间/距离转换器帮助(ptII)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

继我最近在这个新闻组发表的帖子中,我得承认我是b $ b挣扎。我没有使用javascript或它的工作经验。我想要的是一个简单的转换器,允许用户输入行进的距离
以英里为单位的
以及以小时和分钟为单位的时间,结果是平均值

速度。我会感激的是有人为我写剧本,如果可能的话,请在这里发布
。我愿意学习,但不知道从哪里开始

,我找不到任何能帮助我的教程!


谢谢.. .Andre

Further to my recent post in this newsgroup i''ve got to admit i''m
struggling. I''ve no experience with javascript or it''s workings. What i''d
like is a simple converter to allow a user to input the distance travelled
in miles and the time in hours and minutes, the result being an average
speed. What i''d appreciate is for someone to write the script for me and
post here if possible. I am willing to learn but don''t know where to start
and i''ve found no tutorial that will help me!

Thanks...Andre

推荐答案

2007年3月3日星期六22:10:04 +0100,Dirntknow< no **** @ please.comwrote:
On Sat, 03 Mar 2007 22:10:04 +0100, Dirntknow <no****@please.comwrote:

除了我最近在这个新闻组中发表的帖子,我还得承认我是b $ b挣扎。我没有使用javascript或它的工作经验。我想要的是一个简单的转换器,允许用户输入距离

旅行

英里里程和时间和分钟,结果是平均

的速度。我会感激的是有人为我写剧本,如果可能的话,请在这里发布
。我愿意学习,但不知道在哪里开始

我找不到任何可以帮助我的教程!

谢谢... Andre

Further to my recent post in this newsgroup i''ve got to admit i''m
struggling. I''ve no experience with javascript or it''s workings. What i''d
like is a simple converter to allow a user to input the distance
travelled
in miles and the time in hours and minutes, the result being an average
speed. What i''d appreciate is for someone to write the script for me and
post here if possible. I am willing to learn but don''t know where to
start
and i''ve found no tutorial that will help me!

Thanks...Andre



假设您想在网页中运行此脚本:


< html>

< head>

< title>将距离和时间转换为速度< / title>

< script type =" text / javascript">

函数Calculate(){

var theDistance = new Number(document.forms [''theForm''] .txtDistance.value);

var theTimeUsed = new Number(document.forms [''theForm'']。txtTimeUsed.value);

if(!NaN(theDistance) )&&!NaN(theTimeUsed)&&(theTimeU sed> 0)){

document.forms [''theForm'']。txtResult =(theDistance /(theTimeUsed / 60) ));

返回true;

}

返回false;

}

< / script>

< / head>

< bo dy>

< h1>将距离和时间转换为速度< / h1>

< form name =" theForm" ID = QUOT; theForm"行动= QUOT;#" onsubmit =" Calculate();返回

false;">

< fieldset>< legend>输入信息:< / legend>

< p>< label for =" txtDistance">距离:< input type =" text"

name =" txtDistance" ID = QUOT; txtDistance"值= QUOT; 0" /(以英里为单位)。< / label>< / p>

< p>< label for =" txtTimeUsed">使用的时间:< input type =" text" ;

name =" txtTimeUsed" ID = QUOT; txtTimeUsed"值= QUOT; 0" /(以分钟为单位)。< / label>< / p>

< / fieldset>

< fieldset>< legend>选项< / legend>

< p>< input type =" reset"值= QUOT;取消] /< input type =" submit"

value =" Calculate!" />< / p>

< / fieldset>

< fieldset>< legend>结果< / legend>

< p>< label for =" txtResult">平均速度:< input type =" text"

name =" txtResult" ID = QUOT; txtResult"值= QUOT; 0" /(英里/小时)。< / p>

< / fieldset>

< / body>

< / html> ;


-

使用Opera革命性的电子邮件客户端: http://www.opera.com/mail/


2007年3月3日星期六22:26:34 +0100,OmegaJunior

< om ********* @ spamremove.omegajunior.netwrote:
On Sat, 03 Mar 2007 22:26:34 +0100, OmegaJunior
<om*********@spamremove.omegajunior.netwrote:

2007年3月3日星期六22:10:04 +0100,Dirntknow< no **** @ please.comwrote:
On Sat, 03 Mar 2007 22:10:04 +0100, Dirntknow <no****@please.comwrote:

>继续我的这个新闻组最近的帖子我不得不承认我在努力奋斗。我没有使用javascript或它的工作经验。我想要的是一个简单的转换器,允许用户以英里为单位输入行走的距离以及以小时和分钟为单位的时间,结果是平均值
速度。我会感激的是有人为我写剧本,如果可能的话,请在这里发帖。我愿意学习,但不知道从哪里开始
我找不到任何可以帮助我的教程!

谢谢... Andre

>Further to my recent post in this newsgroup i''ve got to admit i''m
struggling. I''ve no experience with javascript or it''s workings. What
i''d
like is a simple converter to allow a user to input the distance
travelled
in miles and the time in hours and minutes, the result being an average
speed. What i''d appreciate is for someone to write the script for me and
post here if possible. I am willing to learn but don''t know where to
start
and i''ve found no tutorial that will help me!

Thanks...Andre



假设您想在网页中运行此脚本:


< html>

< head>

< title>将距离和时间转换为速度< / title>

< script type =" text / javascript"> ;

函数Calculate(){

var theDistance = new

Number(document.forms [''theForm'']。txtDistance.value );

var theTimeUsed = new

Number(document.forms [''theForm'']。txtTimeUsed.value);

if( !NaN(theDistance)&&!NaN(theTimeUsed)&&(theTimeU sed> 0)){

document.forms [''theForm'']。txtResult =(theDistance /

(theTimeUsed / 60));

返回true;

}

返回false;

}

< / script>

< / head>

< body>

< h1>将距离和时间转换为速度< / h1>

< form name =" theForm" ID = QUOT; theForm"行动= QUOT;#"

onsubmit =" Calculate(); return false;">

< fieldset>< legend>输入信息:< / legend>

< p>< label for =" txtDistance">距离:< input type =" text"

name =" txtDistance" ID = QUOT; txtDistance"值= QUOT; 0" /(以英里为单位)。< / label>< / p>

< p>< label for =" txtTimeUsed">使用的时间:< input type =" text" ;

name =" txtTimeUsed" ID = QUOT; txtTimeUsed"值= QUOT; 0" /(在

分钟内)。< / label>< / p>

< / fieldset>

< fieldset>< ;图例>选项< / legend>

< p>< input type =" reset"值= QUOT;取消] /< input type =" submit"

value =" Calculate!" />< / p>

< / fieldset>

< fieldset>< legend>结果< / legend>

< p>< label for =" txtResult">平均速度:< input type =" text"

name =" txtResult" ID = QUOT; txtResult"值= QUOT; 0" /(英里/小时)。< / p>

< / fieldset>

< / body>

< / html> ;


Assuming you want to run this script in a web page:

<html>
<head>
<title>Converting distance and time into speed</title>
<script type="text/javascript">
function Calculate() {
var theDistance = new
Number(document.forms[''theForm''].txtDistance.value);
var theTimeUsed = new
Number(document.forms[''theForm''].txtTimeUsed.value);
if(!NaN(theDistance)&&!NaN(theTimeUsed)&&(theTimeU sed>0)) {
document.forms[''theForm''].txtResult = (theDistance /
(theTimeUsed/60));
return true;
}
return false;
}
</script>
</head>
<body>
<h1>Converting distance and time into speed</h1>
<form name="theForm" id="theForm" action="#"
onsubmit="Calculate();return false;">
<fieldset><legend>Enter information:</legend>
<p><label for="txtDistance">Distance: <input type="text"
name="txtDistance" id="txtDistance" value="0" /(in miles).</label></p>
<p><label for="txtTimeUsed">Time Used: <input type="text"
name="txtTimeUsed" id="txtTimeUsed" value="0" /(in
minutes).</label></p>
</fieldset>
<fieldset><legend>Options</legend>
<p><input type="reset" value="Cancel" /<input type="submit"
value="Calculate!" /></p>
</fieldset>
<fieldset><legend>Result</legend>
<p><label for="txtResult">Average speed: <input type="text"
name="txtResult" id="txtResult" value="0" /(miles per hour).</p>
</fieldset>
</body>
</html>



Ack。 Forgot< / formbefore< / body> ;.

-

使用Opera的革命性电子邮件客户端: http://www.opera.com/mail/

OmegaJunior< om ********* @ spamremove.omegajunior.netwrote:

< snip>
OmegaJunior <om*********@spamremove.omegajunior.netwrote:
<snip>

if(!NaN(theDistance)&&!NaN(theTimeUsed)&&(theTimeU sed> 0)){
if(!NaN(theDistance)&&!NaN(theTimeUsed)&&(theTimeU sed>0)) {



< snip ^^^^^^^^^^^^^^^^


试图拨打电话号码不会生效。


Richard。

<snip ^^^^^^^^^^^^^^^^

Attempting to call a number is not going to be effective.

Richard.


这篇关于时间/距离转换器帮助(ptII)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆