小白关于alert不执行的问题

qq_22041917 2017-05-03 05:40:52
是下面这么写的
<html>
<script type = 'text/javascript'>
var a = 3;
var b = 'name';
var c = null;
alert('a的类型为 ' + (typeof a) + '\nb的类型为 ' + (type b) + '\nc的类型为 ' + (typeof c));
</script>
</html>
打开网页没反应

写成下面这样
<html>
<script type = 'text/javascript'>
alert('提示');
</script>
</html>
就没问题。
这是怎么回事?

刚接触,也没人问,请大家多多指导。
...全文
178 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_22041917 2017-05-04
  • 打赏
  • 举报
回复
引用 2 楼 yt412182782 的回复:
改成这样:alert('a的类型为 ' + (typeof a) + '\nb的类型为 ' + (typeof b) + '\nc的类型为 ' + (typeof c));
感谢解答!
qq_22041917 2017-05-04
  • 打赏
  • 举报
回复
引用 1 楼 functionsub 的回复:
alert('a的类型为 ' + (typeof a) + '\nb的类型为 ' + (typeof b) + '\nc的类型为 ' + (typeof c));
十分感谢!
_花开蒂落_ 2017-05-03
  • 打赏
  • 举报
回复
改成这样:alert('a的类型为 ' + (typeof a) + '\nb的类型为 ' + (typeof b) + '\nc的类型为 ' + (typeof c));
functionsub 2017-05-03
  • 打赏
  • 举报
回复
alert('a的类型为 ' + (typeof a) + '\nb的类型为 ' + (typeof b) + '\nc的类型为 ' + (typeof c));

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧