Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/394.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何通过meteor会话更改div中的html代码?_Javascript_Meteor - Fatal编程技术网

Javascript 如何通过meteor会话更改div中的html代码?

Javascript 如何通过meteor会话更改div中的html代码?,javascript,meteor,Javascript,Meteor,是否可以通过meteor会话更改div容器中的html代码 我的html代码是 <template name="frame"> <div class="container-fluid"> {{html}} </div> </div> </template> 我想根据会话值用不同的html代码更改{{html}}。 这可能吗?我怎样才能做到这一点 我使用meteor和bootstrap 干杯 我发现您的代码唯一的问题是菜

是否可以通过meteor会话更改div容器中的html代码

我的html代码是

<template name="frame">
  <div class="container-fluid">
   {{html}}
  </div>
 </div>
</template>
我想根据会话值用不同的html代码更改{{html}}。 这可能吗?我怎样才能做到这一点

我使用meteor和bootstrap


干杯

我发现您的代码唯一的问题是
菜单中的事件。对于多个事件,您需要分别指定哪个元素将接收它:

Template.menu.events({
  'tap .vermaltung, click .verwaltung': function() {
    Session.set('current_frame', 1);
  }
}

好吧,从meteor的文档来看应该没问题
Template.menu.events({
  'tap .vermaltung, click .verwaltung': function() {
    Session.set('current_frame', 1);
  }
}