即使使用target =" _blank"也无法在新标签页中打开网址

时间:2017-07-06 10:25:03

标签: javascript html

我无法在新标签页中打开该网址。请帮助。

Javascript:



    import { BrowserModule } from '@angular/platform-browser';
    import { NgModule } from '@angular/core';
    import { FormsModule } from '@angular/forms';
    import { HttpModule } from '@angular/http';
    import { Input } from '@angular/core';
    import { ViewChild } from '@angular/core';
    import { Output } from '@angular/core';
    import { AppComponent } from './app.component';
    import { HeaderComponent } from './header/header.component';
    import { PlayersBoardComponent } from './players-board/players-board.component';
    import { PlayerComponent } from './players-board/player/player.component';
    import { ScoresComponent } from './players-board/scores/scores.component';
    import { CopmPlayerComponent } from './players-board/copm-player/copm-player.component';

    @NgModule({
      declarations: [
        AppComponent,
        HeaderComponent,
        PlayersBoardComponent,
        PlayerComponent,
        ScoresComponent,
      ],
      imports: [
        BrowserModule,
        FormsModule,
        HttpModule,
        ViewChild
      ],
      providers: [],
      bootstrap: [AppComponent]
    })
    export class AppModule { }

def feature_selection_technique(train, test, lbls, technique):
   if technique == "variance":
        sel = VarianceThreshold(threshold=(0.00010 * (1 - .15)))
        new_train=sel.fit_transform(train)
        new_test = sel.transform(test)

    return new_train, new_test




由于

1 个答案:

答案 0 :(得分:1)

您在return false;中设置onclick并使用document.location

尝试将document.location更改为window.open功能

的JavaScript

var trackOutboundLink = function(url) {
  ga('send', 'event', 'outbound', 'click', url, {
    'transport': 'beacon',
    'hitCallback': function() {
      window.open(url);
    }
  });
}

HTML

<a href="https://twitter.com/" class="fa-twitter" target="_blank" onclick="trackOutboundLink('https://twitter.com/'); return false;"><span class="label">Twitter</span></a>