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

今天发现一个小菜鸟的问题,点击登录时,没法弹出登陆框,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. 【转】解决Delphi WebBrowser 无法调用当前浏览器的版本

    procedure TregedtIE.FormCreate(Sender: TObject);   begin     WriteAppNameToReg;     WebBrowser1.Navi ...

  2. cocos2dx UI总结

    1.a->addChild(b); 如果b是一个layer,则默认是忽略锚点的,此时无论你怎么设置它的锚点都没用,必须先b->ignoreAnchorPointForPosition(fa ...

  3. Unbuntu下使用SVN

    一.查看SVN版本 svn --version 二.查看SVN仓库 # 查看被svn仓库占用的所有端口 netstat -anp |grep svn # 查看所有端口对应的仓库 ps -ef | gr ...

  4. mysql 自动备份和nginx自动安装脚本

    一.自动备份Mysql脚本: 如下脚本为mysql自动备份脚本,仅供参考,可以根据实际情况修改. #!/bin/sh #auto backup mysql #wugk #Define PATH定义变量 ...

  5. 【转】封装Lua for C#

    原文:http://blog.csdn.net/rcfalcon/article/details/5583095 为了搞懂LUA在我们的GDEX中到底怎么用,我决定研究一下如何比较好的在WPF里封装一 ...

  6. css样式增加&改变颜色

    .listyle{ color:blue; background-color:red /* background-color:"#006633" */ } .intro{ font ...

  7. 复旦大学2015--2016学年第二学期高等代数II期末考试情况分析

    一.期末考试成绩班级前几名 胡晓波(90).杨彦婷(88).宋卓卿(85).唐指朝(84).陈建兵(83).宋沛颖(82).王昊越(81).白睿(80).韩沅伯(80).王艺楷(80).张漠林(80) ...

  8. static变量引起的问题,List数据覆盖

    出现的问题:Listt加载数据时,后面加载的数据会覆盖前面的数据,把后面的数据变得和前面一样 原因:因为刚开始把添加的数据写成了静态变量,所以一个改了以后所有都改了 解决方法:把数据设成普通属性,非静 ...

  9. Learn GIT

    1.创建版本库: git init 设置用户: git config --global user.email "you@example.com" 2.添加到仓库(将修改的内容提交到 ...

  10. 准备阶段-mongodb数据库安装

    具体安装步骤,请参阅 mongoDB(win7_64位)使用手册1.0