Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/440.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中的Firefox登录不起作用_Javascript_Coffeescript_Meteor - Fatal编程技术网

Javascript Meteor中的Firefox登录不起作用

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

我正在尝试开发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-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()

请参考此答案。