input是自我closures,不应该有内容

当我加载我的易捷版网页时,出现以下错误:

Express 500错误:/app/views/index.jade:114 112 | td 2 113 | td 4年> 114 | input是自我closures,不应该有内容。

112| td 2 113| td 4 years > 114| input is self closing and should not have content. at Object.Compiler.visitTag (/app/node_modules/jade/lib/compiler.js:434:15) at Object.Compiler.visitNode (/app/node_modules/jade/lib/compiler.js:210:37) at Object.Compiler.visit (/app/node_modules/jade/lib/compiler.js:197:10) at Object.Compiler.visitBlock (/app/node_modules/jade/lib/compiler.js:278:12) at Object.Compiler.visitNode (/app/node_modules/jade/lib/compiler.js:210:37) at Object.Compiler.visit (/app/node_modules/jade/lib/compiler.js:197:10) at Object.Compiler.visitTag (/app/node_modules/jade/lib/compiler.js:443:12) at Object.Compiler.visitNode (/app/node_modules/jade/lib/compiler.js:210:37) at Object.Compiler.visit (/app/node_modules/jade/lib/compiler.js:197:10) at Object.Compiler.visitBlock (/app/node_modules/jade/lib/compiler.js:278:12) 

这不会显示在本地运行与工头启动,只有当它在服务器上。

看起来你已经有了你的input标签内容。 在HTML中,input标签不能有内容,
因此你应该在你的jade文件的input标签后面删除任何空格或者字符。
例如:
input(type="text",name="whatever") something
应该
input(type="text",name="whatever",value="something")

有时候,答案比同一行中的标签之后的一些内容(比如几个空格)要稍微复杂一些。 注意input标签被错误缩进后的行。

运行到同一个错误后,我正在检查错误报告中标记的玉石模板行。 它实际上包含了input定义,但是这个定义没有任何空格和可打印的内容成功。 下面一行甚至没有缩进(开始另一行forms的两个级别),因此肯定没有在标记行中定义input元素的内容。

然而,还有一个input成功,这个标记在模板后面几行。 而且这个input元素确实有一些从属的内容。 删除内容有一些误判“在这里”。

我有一个类似的问题,我解决了这个问题:

 div +inputWithTextContent('whatever', 'something') mixin inputWithTextContent(name, message) !='<input type="text" name="'+name+'">'+message+'</input>' 

另一个解决scheme是在input后创build一个标签,然后将其内联显示。 这将标签旁边的控制。 这就是我用jade中的checkboxinput来解决问题的方法。

JADE(Bootstrap):

  .checkbox label input(type='checkbox', value='remember-me',) label.inlineLabel Remember me 

上海社会科学院:

 label.inlineLabel display: inline