【问题标题】:Metor iron router - external redirectMeteor Iron 路由器 - 外部重定向
【发布时间】:2015-12-13 04:46:17
【问题描述】:

目前我有下面的代码 - 问题是模板'旧浏览器不能为 ie8 呈现。我可以将外部重定向到外部页面吗?

Router.map(function() {


  this.route('main', {
    path: '/',
    layoutTemplate: 'layout',
    template: 'main',
      onBeforeAction: function () {
            // render the unsupported browser page if user isn't using Chrome
            if(BrowserDetect.browser == "Explorer" && BrowserDetect.version < 10){
                this.redirect('oldbrowser');

            }

          this.next();
      },
  });

});

【问题讨论】:

    标签: redirect meteor iron-router


    【解决方案1】:

    不要使用this.redirect(),而是使用:

    window.location = 'http://externalurl.com';
    

    此时您没有使用 ir 进行路由,因为它不知道 外部 路由。

    【讨论】:

      猜你喜欢
      • 2015-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-03
      • 2015-10-16
      相关资源
      最近更新 更多