我的代码哪里错了?

来源:2-10 我或你都可以 (逻辑或操作符)

kw155

2017-09-02 11:17

为什么输出正常,慕课却提示我有错误?

http://static.mukewang.com/img/59aa22980001700801660065.jpg

http://static.mukewang.com/img/59aa22980001b19904050050.jpg

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>逻辑或</title>
<script type="text/javascript">
var numa,numb,jq1;
numa=50;
numb=55;
jq1=numa>numb || numa==numb;
document.write("jq1的值是:"+jq1+"<br>");
</script>
</head>
<body>
</body>
</html>


写回答 关注

5回答

  • 慕粉4028731
    2017-09-03 13:46:30
    已采纳

    jq1=numa>numb||numa==numb;不需要空格

    慕神9295...

    我也觉得这个编译器挺奇葩的

    2019-03-13 13:06:02

    共 2 条回复 >

  • qq_慕神1420022
    2022-05-17 20:04:52

    听着没问题,说的不错,支持下

    wxpoddnygmpbkynbawdcxegxinkira

  • 一只胡思乱想的猪
    2017-09-22 15:38:48

    运行没问题的,只是会提示错误而已

  • 慕工程6256650
    2017-09-02 11:52:21

    用自己编译器测试比较好! 这个毕竟有很多BUG的!

  • 慕工程6256650
    2017-09-02 11:49:37

    11行 

    jq1=numa>numb || numa==numb;

    ||左右两边没有空格符

    慕工程625... 回复kw155

    我是说这里面不用空格。

    2017-09-04 13:23:22

    共 2 条回复 >

JavaScript进阶篇

本课程从如何插入JS代码开始,带您进入网页动态交互世界

467393 学习 · 21877 问题

查看课程

相似问题