When the project uses easyUI, the foreground reports an error, type error: A is undefined. I see that the error location is actually the source code of JQ… It’s impossible. I searched a lot of information on the Internet, but I didn’t solve the problem. After nearly a month’s thinking, I seem to have found the cause of this problem. It may not be right. It only represents personal profile. If there is a positive solution, please let me know. Thank you.
The error screenshot is as follows:
The reasons are as follows: I have such a piece of code in JS:
$('#cargo_info').datagrid().datagrid('getPager');
Note that this code is not put in any function, nor is it wrapped with $(function () {}). Just this sentence is put directly in JS code. This is all the cases that report this error in my project. My preliminary analysis is because JS thinks that there is no method to call this sentence, so it reports an error.
Solution: wrap the isolated statements in JS with $(function () {}), or write them in a function,
<pre name="code" class="javascript">$(function(){
$('#cargo_info').datagrid().datagrid('getPager');
})
Like this, you can’t make a mistake at the front desk
Read More:
- about jQuery.js The solution to always reporting errors
- In Vue, use echorts to report an error: “typeerror: cannot read property ‘init’ of undefined” error reporting reason and solution
- JQuery is a solution to the disappearance of listening events after adding elements with append
- Error reported by nodejs server of CentOS system: solution to cannot find module ‘jQuery’
- Vue uses this. $refs. Subcomponent Ref. method to report an error: cannot read property ‘resetfields’ of undefined problem
- The solution of undefined reference to error
- Call to undefined function mysql_ Connect() solution summary
- Solution to the problem of “undefined external error” after registering PBX of microsip
- Solution to the problem of vs2017 error report unable to open source file
- Solution of idea using @ Autowired annotation to report errors
- Using jgit to report errors: the solution of algorithm negotiation failure
- Solution to error report of Jackson coordinate introduced by spring
- About “undefined reference to” when compiling uboot__ aeabi_ unwind_ cpp_ The solution of “PR0 ‘”
- QT: error: undefined reference to ‘XXXX’ error prompt, solution
- Solution to the flash back, error report and unexpected exit of idea MAC windows
- The solution of using Autowired annotation to report errors in IntelliJ idea
- JQuery: How to get the selected values of checkbox, radio and select
- PHP under linux uses pdo-dblib to connect to mssql to report an error solution. Error message: SQLSTATE[01002] Adaptive Server connection failed (severity 9)
- Using pop-up window and I18N, error in render: “typeerror: cannot read property” appears_ T ‘of undefined’ solution
- When generating a test report in HTML format, report [typeerror: a bytes like object is required, not ‘STR’]