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用" ...
随机推荐
- c# wpf定时器的一种用法
1.xaml页面 <Window x:Class="EssentialWPF.MainWindow" xmlns="http://schemas.microsoft ...
- WPF的路由事件、冒泡事件、隧道事件(预览事件)
本文摘要: 1:什么是路由事件: 2:中断事件路由: 3:自定义路由事件: 4:为什么需要自定义路由事件: 5:什么是冒泡事件和预览事件(隧道事件): 1:什么是路由事件 WPF中的事件为路由事件,所 ...
- Socket之TCP连接_TcpNoDelay
摘自: http://jerrypeng.me/2013/08/mythical-40ms-delay-and-tcp-nodelay/
- 源码剖析——深入Windows句柄本质
参考资料: 1. http://www.codeforge.cn/read/146318/WinDef.h__html windef.h头文件 2. http://www.codeforge.cn/r ...
- react native改变app的图标和名称
beauty\android\app\src\main\res
- heart beat/心跳包
为什么需要heart beat/心跳包?因为tcp keep-alive不能满足人们的实时性的要求,就是这么简单. socket的长时间连接的话,是需要心跳包.心跳包就是维持双方的连接,每隔一段时间发 ...
- CFNetwork的错误代码参考
所有的错误代码是在对“CFNetwork的错误代码参考” 小提取CFURL和CFURLConnection错误: kCFURLErrorUnknown = -998, kCFURLErrorCance ...
- 如何为数据源向导填加一种自定义的数据源类型(win示例)
https://www.devexpress.com/Support/Center/Example/Details/T310160
- 通过nginx代理之后,获取客户端ip
1.相关nginx配置(通过header将客户端ip,host等信息传入) location ~ .*.do$ { proxy_set_header X-Real-IP $remote_addr; p ...
- python pyqt4 ide eric安装
注意事项 关于python,pyqt的版本 笔者安装的是eric,原来电脑安装的是64位的python,32位的pyqt4,导致系统找不到pyqt,后来更换python版本为32搞定,猜测pyqt的版 ...