m0_46499515 2021-01-21 09:40 采纳率: 0%
浏览 15

麻烦大神看看这个代码哪里错了,怎么修改?小白求助

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>repl.it</title>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script src="script.js">
      var doccolor="ff80ff";
      function calculation(a, b, c){
var a = age;
var b = gender;
var c = phone;
function calage(age){
if(age>0.5 && age<=0.6){
        return 1;
        else if(age>0.6 && age<=0.65){
          return 2;
          else if(age>0.65 && age <=7){
            return 3;
            else if(age>0.7 && age <=0.75){
              return 4;
              else if(age >0.75 && age <=0.8){
                return 5:
                else if(age >0.8 && age <= 0.85){
                  return 6:
                  else if(age >0.85){
                    return 7;
                  }
                }
              }
            }

          }
        }
      }}

function calgender(gender){
  if(gender>0.6 && gender<= 0.75){
    return 2;
    else if(gender >0.75&& gender< 0.9){
      return 4;
      else if(gender > 0.9){
        return 6;
      }
    }
  }
}

function calphone(phone){
  if (phone>0.2 && phone <=0.3){
    return 1;
    else if (phone >0.3 && phone <=0.4){
      return 2;
      else if (phone >0.4 && phone<= 50){
        return 3;
        else if(phone>0.5){
          return 4;
        }
      }
    }
  }
}
var resu
a + b + c = resu
return resu;
}


      </script>
  </head>
  <body bgcolor="ffffff" onload="resetCounters();" data-new-gr-c-s-check-loaded="14.991.0" data-gr-ext-installed="">

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>

<b>By Tylor Lee</b></font></td>
</tr>
</tbody></table>
<p>
  </p><blockquote>

<font size="+1">
<b>Rating system</b>
</font><br>
Type in the following requirement to get the points of the KOL
<p>

</p><form name="powermod">
<table border="1" align="center">  
  <tbody><tr>
<td>Age: 
<input type="text" value="" name="aaa" onchange="pmout.value='';"></td>
<td>phone:
<input type="text" value="" name="iphone" onchange="pmout.value='';"></td>
<td>gender:
<input type="text" value="" name="female" onchange="pmout.value='';"></td>
</tr>
<tr>
<td>
  <input type="button" value="Compute" onclick="pmout.value = calculation(aaa,female,iphone);">
</td>
   <td align="right">
<i>result</i> =
</td>
<td bgcolor="bbbbbb"><input type="text" value="" name="pmout" onchange="pmout.value='';">
</td>
</tr>
</tbody></table>
</form>


<p>
<font size="0">
The program is written in JavaScript,
and runs on the client computer.
</font>
</p><p>


</p></blockquote>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody><tr>

</tr>
</tbody></table>
<p>


    
  </body>
</html>

小白求助,很基础的问题 谢谢大神

  • 写回答

12条回答 默认 最新

  • BCS-点心 2021-01-21 09:48
    关注

    代码太长,一行行找太麻烦,不写注释不分层的弊端。

    你把你的代码,按页面元素划分,一块块注释掉,看看问题在哪。

    如果是js的问题,一样操作,小范围注释缩小问题点。

    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看