想必大家现在都已经到家了,而苦逼的我还要坐在办公室混拿微薄的工资,技不如人,平常不努力给自己充电,年终一毛钱都没多给。不说这扫兴的话题了,在这给同样在苦逼坚守岗位的同志们节日的问候,新的一年,好运连连,美梦成真,实现自我!

今天发现一个小菜鸟的问题,点击登录时,没法弹出登陆框,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的更多相关文章

  1. react native错误排查-TypeError: window.deltaUrlToBlobUrl is not a function

    错误现象:window.deltaUrlToBlobUrl is not a function 最近在调试react-native时,打开浏览器调试时发现报错window.deltaUrlToBlob ...

  2. Uncaught TypeError: window.showModalDialog is not a function

    if(window.showModalDialog == undefined){ window.showModalDialog = function(url,mixedVar,features){ w ...

  3. Uncaught TypeError: window.showModalDialog is not a function 谷歌

    //新版本谷歌没有window.showModalDialog,创建一个window.openif(window.showModalDialog == undefined){ window.showM ...

  4. 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 ...

  5. 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 ...

  6. window.onload和$(document).ready(function(){})的区别

    前段时间在面试之前查找并整理了一下window.onload和$(document).ready(function(){})区别,今天有时间更到我的博客上,由于本人资历尚浅,如有不对的地方,还请指正. ...

  7. Meteor错误:TypeError: Meteor.userId is not a function

    问题描述: 浏览器console提示错误TypeError: Meteor.userId is not a function. 原因分析: 通过查看Meteor API文档,可知该函数由包accoun ...

  8. extjs之TypeError: d.read is not a function解决方案

    在创建如下代码时报出此错:TypeError: d.read is not a function Ext.define('shebyxgl_sheb_model', { extend: 'Ext.da ...

  9. $(window).width() is not a function

    昨天在帮同事调试JS的时候,FF报错了,$(window).width() is not a function.我以前也是这么用的,都没问题,为什么现在就报错了呢? 这是因为jQuery用" ...

随机推荐

  1. mybatis框架下解决数据库中表的列的字段名和实体类属性不相同的问题

    导包.... 实体类中的属性,getter,setter,tostring,构造等方法就不写了 private int id; private String orderNo; private floa ...

  2. 1.[WP Developer体验Andriod开发]之Andriod布局 VS WinPhone布局

    0.写在前面的话 近来被HTML+CSS的布局折腾的死去活来,眼巴巴的看着CSS3中的flex,grid等更便捷更高效的的布局方式无法在项目中应用,心里那叫一个窝火啊,去你妹的兼容性,,, 最近体验下 ...

  3. MySQL新建用户,授权,删除用户,修改密码

    首先要声明一下:一般情况下,修改MySQL密码,授权,是需要有mysql里的root权限的.注:本操作是在WIN命令提示符下,phpMyAdmin同样适用.    用户:phplamp  用户数据库: ...

  4. (转)sqlplus中文显示乱码的问题

    sqlplus中文显示乱码的问题 2010-07-19 11:33:26 分类: LINUX 在windows下sqlplus完全正常,可是到linux下,sqlplus中文显示就出问题了,总是显示“ ...

  5. word域3

    WORD是文字处理软件,我们在日常处理一些文字时经常遇到一些问题,如:各种公式的录入,尽管Word都提供了"公式编辑器",但其插入的却是"对象",有时排版会感觉 ...

  6. centos7 docker redis

    docker run --name=redistmp -ti centos /bin/bash yum -y install gcc tcl make cd /home wget http://dow ...

  7. 在windows上搭建react-native的android环境

    参考文档: http://facebook.github.io/react-native/docs/getting-started.html http://reactnative.cn/docs/0. ...

  8. hdu-5525 Product(费马小定理)

    题目来源:http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=644&pid=1003 前面用奇偶性约掉2, ...

  9. property内存管理策略

    1普通数据,用weak 2delegate,用weak 3一般对象,用strong 4NSString,用copy 5block,用copy

  10. eslintrc配置翻译

    { "env": { "browser": true, "node": true, "commonjs": true } ...