Javascript Meteor UI中出现异常:错误:非法的HTML属性名称:\
我正在制作Meteor JS应用程序,不断出现以下错误:Javascript Meteor UI中出现异常:错误:非法的HTML属性名称:\,javascript,meteor,iron-router,Javascript,Meteor,Iron Router,我正在制作Meteor JS应用程序,不断出现以下错误: Exception in Meteor UI: Error: Illegal HTML attribute name: \ at extendAttrs (http://localhost:3000/packages/htmljs.js?a0a9082010d25b3fb44e0f56bdd0a7b4e6bbeb93:322:13) at Object.HTML.evaluateAttributes (http://loc
Exception in Meteor UI: Error: Illegal HTML attribute name: \
at extendAttrs (http://localhost:3000/packages/htmljs.js?a0a9082010d25b3fb44e0f56bdd0a7b4e6bbeb93:322:13)
at Object.HTML.evaluateAttributes (http://localhost:3000/packages/htmljs.js?a0a9082010d25b3fb44e0f56bdd0a7b4e6bbeb93:340:3)
at http://localhost:3000/packages/ui.js?9419ac08328918a04e7a49464a988d45f851e1b0:2536:28
at _assign._compute (http://localhost:3000/packages/deps.js?4a82362ae66e863a1c1a8b0a5fec6f665e2038d1:228:38)
at new Deps.Computation (http://localhost:3000/packages/deps.js?4a82362ae66e863a1c1a8b0a5fec6f665e2038d1:160:10)
at Object._assign.autorun (http://localhost:3000/packages/deps.js?4a82362ae66e863a1c1a8b0a5fec6f665e2038d1:380:13)
at materialize (http://localhost:3000/packages/ui.js?9419ac08328918a04e7a49464a988d45f851e1b0:2529:27)
at materialize (http://localhost:3000/packages/ui.js?9419ac08328918a04e7a49464a988d45f851e1b0:2476:7)
at http://localhost:3000/packages/ui.js?9419ac08328918a04e7a49464a988d45f851e1b0:2393:7
at Object._assign.nonreactive (http://localhost:3000/packages/deps.js?4a82362ae66e863a1c1a8b0a5fec6f665e2038d1:400:14)
当我加载一个名为dialogueIndex的页面时,会出现这种情况,该页面列出了Dialogs
集合中元素的编辑页面链接。代码如下:
client/views/dialogue_index.html
================================
<template name="dialogueIndex">
<main>
<h1>Dialogues</h1>
{{#each dialogues}}
<a href="{{pathFor 'editDialogue'}}">Edit</a> - {{summary}} - "{{text}}"
<br \>
{{/each}}
</main>
</template>
client/js/dialogue_index.js
===========================
Template.dialogueIndex.helpers({
dialogues: function() {
return Dialogues.find({});
}
});
lib/routes.js
=============
Router.configure({
layoutTemplate: 'mainLayout',
loadingTemplate: 'loading'
});
Router.map( function() {
...
this.route('dialogueIndex',
{
waitOn: function() { return Meteor.subscribe("dialogues"); },
path: 'dialogue/index'
});
this.route('editDialogue',
{
path: 'dialogue/edit/:_id',
data: function() { return Dialogues.findOne(this.params._id); }
});
});
client/views/dialogue\u index.html
================================
对话
{{{每段对话}
-{{summary}}-“{{text}”
{{/每个}}
client/js/dialogue_index.js
===========================
Template.dialogueIndex.helpers({
对话:函数(){
返回对话。查找({});
}
});
lib/routes.js
=============
路由器配置({
layoutTemplate:“主布局”,
loadingTemplate:“正在加载”
});
Router.map(函数(){
...
this.route('dialogueIndex',
{
waitOn:function(){return Meteor.subscribe(“对话”);},
路径:“对话/索引”
});
这条路线(‘编辑对话’,
{
路径:“对话/编辑/:_id”,
数据:函数(){return dialogs.findOne(this.params._id);}
});
});
我对此困惑了一段时间,但我不知道这里发生了什么。尝试搜索答案,但我没有发现关于这个错误的太多信息。你能提供的任何帮助都会很好
谢谢 将
替换为
旁注:
如果添加
,Meteor抛出的错误将更加精确:
Expected "br\" end tag
哦,天哪,我觉得自己太蠢了。谢谢!我当时正把头撞在墙上,哈哈。
也行。问题是反斜杠--应该是正斜杠