TypeError: window.open is not a function
想必大家现在都已经到家了,而苦逼的我还要坐在办公室混拿微薄的工资,技不如人,平常不努力给自己充电,年终一毛钱都没多给。不说这扫兴的话题了,在这给同样在苦逼坚守岗位的同志们节日的问候,新的一年,好运连连,美梦成真,实现自我!
今天发现一个小菜鸟的问题,点击登录时,没法弹出登陆框,firebug调试报错“TypeError: window.open is not a function”,一直很纳闷,这明明是javascript方法函数,怎么说不是一个函数呢。对js文件全局搜索window.open,没有哪里重新定义啊,再搜搜页面源码“open”,是的,open被定义为一个变量,而且没用var声明。
$(function(){
open = true;
……
}
将open变量用var声明,问题就解决了。
总结:在正常情况下,window.open是一个函数。所以你可能已经在代码中的其他位置重新定义了它,最有可能是定义了一个变量open,没有用var声明。
> window.open
function open(){[native code]}
> open ="test"
"test"
> window.open
"test"
TypeError: window.open is not a function的更多相关文章
- react native错误排查-TypeError: window.deltaUrlToBlobUrl is not a function
错误现象:window.deltaUrlToBlobUrl is not a function 最近在调试react-native时,打开浏览器调试时发现报错window.deltaUrlToBlob ...
- Uncaught TypeError: window.showModalDialog is not a function
if(window.showModalDialog == undefined){ window.showModalDialog = function(url,mixedVar,features){ w ...
- Uncaught TypeError: window.showModalDialog is not a function 谷歌
//新版本谷歌没有window.showModalDialog,创建一个window.openif(window.showModalDialog == undefined){ window.showM ...
- jquery.js 3.0报错, Uncaught TypeError: url.indexOf is not a function
转载自:http://majing.io/questions/432 问题描述 jQuery升级到3.0.0后类型错误 jquery.js:9612 Uncaught TypeError: url ...
- jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function
jquery3.1.1报错Uncaught TypeError: a.indexOf is not a function 使用1.9就没有问题,解决办法: 就是把写的代码中: $(window).lo ...
- window.onload和$(document).ready(function(){})的区别
前段时间在面试之前查找并整理了一下window.onload和$(document).ready(function(){})区别,今天有时间更到我的博客上,由于本人资历尚浅,如有不对的地方,还请指正. ...
- Meteor错误:TypeError: Meteor.userId is not a function
问题描述: 浏览器console提示错误TypeError: Meteor.userId is not a function. 原因分析: 通过查看Meteor API文档,可知该函数由包accoun ...
- extjs之TypeError: d.read is not a function解决方案
在创建如下代码时报出此错:TypeError: d.read is not a function Ext.define('shebyxgl_sheb_model', { extend: 'Ext.da ...
- $(window).width() is not a function
昨天在帮同事调试JS的时候,FF报错了,$(window).width() is not a function.我以前也是这么用的,都没问题,为什么现在就报错了呢? 这是因为jQuery用" ...
随机推荐
- java中post时中文乱码
http://blog.chinaunix.net/uid-12348673-id-3335300.html 设置流的编码,就避免了乱码 public static String post(Strin ...
- Android存储
Android的四种数据存储方式: 1.SharedPrefrences 2.SQLite 3.Content Provider 4.File SharedPrefrences: 1.是一种轻型的数据 ...
- [译]使用JMH进行微基准测试:不要猜,要测试!
英文原文:Micro Benchmarking with JMH: Measure, don't guess!翻译地址:使用JMH进行微基准测试:不要猜,要测试!原文作者:Antonio翻译作者:Ho ...
- tomcat 7+ 启动慢 熵池阻塞变慢详解
原因: Tomcat 7/8都使用org.apache.catalina.util.SessionIdGeneratorBase.createSecureRandom类产生安全随机类SecureRan ...
- Spring MVC控制器
Spring MVC中控制器用于解析用户请求并且转换为模型以提供访问应用程序的行为,通常用注解方式实现. org.springframework.stereotype.Controller注解用于声明 ...
- linux开发摘要
1.linux内核文档链接点击打开链接 2.配置文件 在out\target\product\project\obj\KERNEL_OBJ\.config中可以看到 # CONFIG_MTD_LPDD ...
- 4.添加对efcore的支持 ,并使用mysql数据库。
1.添加并加入 在project.json中添加 "tools": { "Microsoft.EntityFrameworkCore.Tools": " ...
- <转>好婚姻是彼此放心
-01- 临下班,马丽听到隔壁桌的方雅在打电话,声音听起来嗲声嗲气:“有个朋友晚上约我吃饭,要晚点回来,你不用等我了哦.” 电话挂断时,已经到了下班的点.方雅扭头对马丽说:“丽姐,待会我们一起去吃个饭 ...
- [转]什么是SPI通信
SPI:高速同步串行口.3-4线接口,收发独立.可同步进行. SPI,是英语Serial Peripheral interface的缩写,顾名思义就是串行外围设备接口.是Motorola首先在其MC6 ...
- nignx 负载均衡的几种算法介绍
负载均衡,集群必须要掌握,下面介绍的负载均衡的几种算法. 1 .轮询,即所有的请求被一次分发的服务器上,每台服务器处理请求都相同,适合于计算机硬件相同. 2.加权轮询,高的服务器分发更多的请求 ...