使用form的方法(例如:reset,clear等)报错Uncaught TypeError: Cannot read property 'tip' of undefined(…)的原因
2017-08-02 15:27
1031 查看
在浏览器中debug前端代码时,第一次按一个按键,没有问题,第二次开始再按这个按键的时候,出现了错误Uncaught TypeError: Cannot read property 'tip' of undefined(…),虽然不影响功能,但是出现红色的错误总是感觉不好,想解决它。
经过多次实验与测试,发现由于在按键的时候我都会初始化一个日期的选择框datetimebox,第二次再初始化的时候就报错了上述错误;将此初始化放入到页面的初始化之中,也就是只在页面加载的时候初始化一次,而不是在按按键的时候每次都初始化日期选择框,再次测试,发现没有问题了。
经过多次实验与测试,发现由于在按键的时候我都会初始化一个日期的选择框datetimebox,第二次再初始化的时候就报错了上述错误;将此初始化放入到页面的初始化之中,也就是只在页面加载的时候初始化一次,而不是在按按键的时候每次都初始化日期选择框,再次测试,发现没有问题了。
相关文章推荐
- js的form(load报错jquery.easyui.min.js:2837 Uncaught TypeError: Cannot read property 'tip' of undefined
- jquery.dataTables.min.js:62 Uncaught TypeError: Cannot read property 'style' of undefined原因
- 使用UEditor的setContent的时候报错,报错代码如下 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 错
- aes.js:77 Uncaught TypeError: Cannot read property 'extend' of undefined(…)
- Ckeditor: Uncaught TypeError: Cannot read property 'keyCode' of undefined 解决方法
- bug宝典之bootstrap switch Uncaught TypeError: Cannot read property 'apply' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'length' of undefined
- ASP.NET MVC运行出现Uncaught TypeError: Cannot set property __MVC_FormValidation of null的解决方法
- Uncaught TypeError: Cannot read property 'trigger' of undefined(zepto.js)
- UEditor的setContent的时候报错,报错代码如下 Uncaught TypeError: Cannot set property 'innerHTML' of undefined 错
- extjs4:Uncaught TypeError: Cannot read property 'processed' of undefined
- 关于Uncaught TypeError: Cannot read property 'toLowerCase' of undefined的问题
- 在使用renderTo中遇到的Uncaught TypeError: Cannot read property 'insertAdjacentHTML' of null
- Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
- Uncaught TypeError: Cannot read property 'decimalSeparator' of undefined
- echarts.min.js:25 Uncaught TypeError: Cannot read property 'features' of undefined 报错解决方法
- background.js Uncaught TypeError: Cannot read property 'xxx' of undefined
- ASP.NET MVC运行出现Uncaught TypeError: Cannot set property __MVC_FormValidation of null的解决方法
- Uncaught TypeError: Cannot read property 'length' of undefined