Error message:
Uncaught TypeError: Cannot read property ‘toLowerCase’ of undefined
How to solve this error:
The object does not have the correct.
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("No channel selected",{icon:2,time:2000}); return ; } layer.confirm('Sure you want to add the selected channel to this model?', {icon: 3, title:'tips'}, 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 object in the image above has changed. Pay attention to this
Change this to # type, that is, the select tag
Similar Posts:
- [Solved] Computed property “xxxx” was assigned to but it has no setter
- PyTorch :TypeError: exceptions must derive from BaseException
- [reprint] extjs sets the timeout of Ajax request
- When parsing background JSON data with Ajax: unexpected token o in JSON at position 1
- Uncaught Error: _registerComponent(…): Target container is not a DOM element
- [Solved] JS Ajax uploads an error “uncaught type error: illegal invocation”
- How to Solve Datatable field value is empty Error
- Cannot read property ‘data’ of undefined;at api showModal success callback function
- [Solved] Vue Axios error: TypeError: Cannot set property ‘tableData‘ of undefined
- Solve the problem of “typeerror: ‘bool’ object is not callable” in flash and Django