初次接触jade,并且本人只有一点点的html技术基础,所以以下代码仅供jade基本参考,不妥之处,还望大家指点一二。
doctype html
html(lang="en")
head
title marmot
script(src="javascripts/event.js")
//-其实我也不知道这个路径正确与否,但是应该是这么写吧?event.js是放到public/javascripts下面的
body
h1 this is a test of jade & nodejs
div
h5 hello,this is sangoma,I apply the website for I thought I'm a primary programmer who makes much bug
-var user={name:'sangoma',isVIP:false}
//-从这个地方起到下面是练习if语句,注意var前面的-,然后我一开始定义name以及isVIP的时候把他们作为字符串写上了,即'name'、'isVIP',然后下面
//-调用user.isVIP的时候报错说isVIP未定义
#container
- if (user.isVIP)
Get congratrulations,you are our VIP
- else
div
p
| there is no meanning to write this
div
| so why did you do this meaninglessly job
div
label(for="excel") 姓名
input(type="text", name="textName")
div
label(for="sex") 性别
input(type="email", name="mail",value="sangoma@amarmot.com")
//-这个地方有一个小坑,就是你使用提示去填的时候input后面会自动加#,记得删掉,不然到#input就结束了然后就会提示
//-input is self closing and should not have content
input(type="button", value="测试数据取值",name='getButton')
input is self closing and should not have content.问题的处理详见上,其他可能会导致这个问题的bug还没有遇到,遇到在正文修改或者评论区补充。