Javascript Meteor中的Firefox登录不起作用
我正在尝试开发meteor中的登录功能,我正在使用jade手柄和coffeescript 我的咖啡脚本页面:Javascript Meteor中的Firefox登录不起作用,javascript,coffeescript,meteor,Javascript,Coffeescript,Meteor,我正在尝试开发meteor中的登录功能,我正在使用jade手柄和coffeescript 我的咖啡脚本页面: Template.navigation.events "submit #login-form": (e, t) -> e.preventDefault() if Meteor.userId() Meteor.logout() else # retrieve the input field values email = t.find("#login-emai
Template.navigation.events
"submit #login-form": (e, t) ->
e.preventDefault()
if Meteor.userId()
Meteor.logout()
else
# retrieve the input field values
email = t.find("#login-email").value
password = t.find("#login-password").value
# If validation passes, supply the appropriate fields to the
# Meteor.loginWithPassword() function.
Meteor.loginWithPassword email, password, (err) ->
if err
# throw new Meteor.Error(403, "Username must have at least 3 characters")
alert "login unsucess, Please check your email and password currectly"
console.log err
else
alert "sucess"
$('#login-style').toggleClass('hide');
console.log Meteor.userId()
Meteor.Router.to('/')
false
我的翡翠档案:
body
.container
{{> Header}}
{{#isolate}}{{renderPage}}{{/isolate}}
template(name="Header")
{{> navigation}}
template(name="navigation")
{{#if currentUser}}
{{> login}}
{{else}}
{{> loginout }}
{{/if}}
在Chrome中,它可以正常工作,但在Firefox中,我必须刷新页面才能看到登录或注销按钮。尝试返回false而不是e.preventDefault() 请参考此答案。