【问题标题】:Js - window.open doesn´t existJs - window.open 不存在
【发布时间】:2017-07-01 17:53:17
【问题描述】:

当我在 angularjs 应用程序上调用 window.open 时,我得到了这个 error

TypeError: window.open 不是函数

然后我打电话:

console.log(窗口)

所以,这是控制台的图像。 http://i.imgur.com/4k4HrSs.png

我知道是否相关,但是,这是代码:

$scope.ocPDF = function(){
  if($scope.oc.id){
    var width = window.innerWidth - 30;
    var url = 'whatever/' + $scope.oc.id;
    window.open(url, "name","menubar=1,resizable=1,width="+width+",height=500,top=80").focus();
  }
}

我的问题是。我怎样才能重置 js 或者这可能是什么原因? 这很奇怪,因为它在其他领域也有效。所以它不是浏览器。

谢谢!

【问题讨论】:

    标签: javascript angularjs window.open


    【解决方案1】:

    检查window.openopen 是否未在某处分配布尔值。大概就是这样:P

    【讨论】:

    • 天哪,我惊慌失措地进入,因为它在会议中不起作用。我什至没有查看我下载的新库......哈哈哈我的错。谢谢!
    • 哈哈,没问题!祝会议好运,请不要忘记将此标记为问题的答案:) @MauriceLeOlavarriet
    猜你喜欢
    • 2012-04-08
    • 1970-01-01
    • 2011-04-07
    • 2010-10-06
    • 1970-01-01
    • 2022-07-22
    • 2012-05-23
    • 2018-11-06
    • 2018-05-23
    相关资源
    最近更新 更多