【发布时间】:2013-07-15 04:26:53
【问题描述】:
Meteor Session 设置和获取在所有桌面浏览器上对我来说都运行良好,但触发 Session 的相同事件在移动 safari 浏览器上被“破坏”。在仍然使用 Meteor Session 变量的同时是否有解决方法?
这是一些代码的示例。
Template.stream.events({
'click #circusview': function () {
var thisValue = document.getElementById("circusview");
var thisVal = thisValue.getAttribute("title");
Session.set("selected", thisVal);
var theSesh = Session.get("selected");
}
})
Template.tweet.tmplView = function () {
var thisSesh = Session.get('selected');
return thisSesh;
}
<template name="tweet">
<div id="{{tmplView}}" class="tweet" style="background-image: url( '{{backImg}}' )" >
<img class="profile" src="{{profileImg}}">
<span class="name">{{screenName}}</span>
<span class="message"> {{thisMessage}}</span>
</div>
</template>
此代码在桌面浏览器上的作用就像一个魅力,但在移动 safari 上却不行。感谢您的帮助。
【问题讨论】: