Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
2016-10-11 00:00
781 查看
报错的内容:
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
解决方案:
参考的url:
http://stackoverflow.com/questions/23723005/uncaught-typeerror-cannot-read-property-tolowercase-of-undefined
对象没有正确:
incorrect:
上图中的this对象已经变了。注意这一点
将this修改成#type ,也就是select标签即可
Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
解决方案:
参考的url:
http://stackoverflow.com/questions/23723005/uncaught-typeerror-cannot-read-property-tolowercase-of-undefined
对象没有正确:
incorrect:
$("#type").change(function(){ //获取选中的 if($(this).val()==''){ return; } var choose= new Array(); $("input[name='choose[]']:checkbox").each(function(){ if($(this).prop("checked") == true){ choose.push($(this).val()); } }); if(choose == ''){ layer.msg("没有选中频道",{icon:2,time:2000}); return ; } layer.confirm('确定要将选中的频道添加到该机型中?', {icon: 3, title:'提示'}, function(index){ $.ajax({type:"post",timeout:"<?php echo TIMEOUT;?>",url:"<?php echo base_url('channel/defchanneladd');?>", data:{choose:choose,tvmodel_id:$("#this").val()},success:function(data){ var obj = JSON.parse(data); layer.msg(obj.msg, {icon: obj.code,time:1000},function(){ if(obj.code == '1'){ window.location.reload(); } }); }}); }); });
上图中的this对象已经变了。注意这一点
将this修改成#type ,也就是select标签即可
相关文章推荐
- 关于Uncaught TypeError: Cannot read property 'toLowerCase' of undefined的问题
- Uncaught TypeError: Cannot read property 'length' of undefined
- bug之bootstrap switch Uncaught TypeError: Cannot read property 'apply' of undefined
- extjs4:Uncaught TypeError: Cannot read property 'processed' of undefined
- Uncaught TypeError: Cannot read property 'decimalSeparator' of undefined
- Uncaught TypeError: Cannot read property 'trigger' of undefined(zepto.js)
- Uncaught TypeError: Cannot read property 'length' of undefined
- Uncaught TypeError: Cannot read property 'substring' of undefined
- Uncaught TypeError: Cannot read property 'substring' of undefined
- 浏览器报Uncaught TypeError: Cannot read property 'trigger' of undefined解决方案
- 解决sweetalert 无故报错 elem.className.replace Uncaught TypeError: Cannot read property 'className' of ...
- DataTable插件报错:Uncaught TypeError: Cannot read property 'style' of undefined
- Uncaught TypeError: Cannot read property 'msie' of undefined
- aes.js:77 Uncaught TypeError: Cannot read property 'extend' of undefined(…)
- js的form(load报错jquery.easyui.min.js:2837 Uncaught TypeError: Cannot read property 'tip' of undefined
- 浏览器报Uncaught TypeError: Cannot read property 'trigger' of undefined解决方案
- bug宝典之bootstrap switch Uncaught TypeError: Cannot read property 'apply' of undefined
- Uncaught TypeError: Cannot read property 'msie' of undefined
- echarts.min.js:25 Uncaught TypeError: Cannot read property 'features' of undefined
- Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'