我刚刚注意到Chrome显示此错误。但是所有错误似乎都来自jquery。我正在使用3.3.1
jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:490 Uncaught TypeError: Cannot use 'in' operator to search for 'length' in <!DOCTYPE html><html><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type" /><title>Dashboard</title><meta name="csrf-param" content="authenticity_token" />
<meta name="csrf-token" content="2l0g396By+J4FUfg5YFk+Ezs9nv2U8qosLCxgIgTgf8I0h0AYGZHD0mMPDLRaZ61rDKbbX77AHT9hdyeSEGT9w==" /><link rel="stylesheet" media="all" href="/assets/proofreader.self-8f5797834c65eb82f578a7f8991c78991f6b2bcd59cb63500a3f9f726c4ceba2.css?body=1" data-turbolinks-track="reload" /><script src="https://www.gstatic.com/charts/loader.js"></script><script src="/assets/jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/rails-ujs.self-3b600681e552d8090230990c0a2e8537aff48159bea540d275a620d272ba33a0.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/popper.self-70e1b2b78096eb80eb35ebac513e7a8007033ee3e881919cfdca4ece7779cffd.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/recurring_select_dialog.self-08390047c867ad439a8c5b0356bf66ea17e3540bedd063ccd25e1631c2104ac8.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/recurring_select.self-e0d7bfb20b0db760d19d037c71b441b0cb6d9e33d13abe7ea0f61525e991b3ac.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/moment.min.self-9724928ad9316eef6298faba547bbe9ea9930467e7e1965fbb06391da067dee6.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/bootstrap.self-71784756e8d3ffaa8c7ffebc434ed774344cdf0d46c66c6af4a62d4504ef7ba3.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/activestorage.self-0525629bb5bac7ed5f2bfc58a9679d75705e426dafd6957ae9879db97c8e9cbe.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/turbolinks.self-569ee74eaa15c1e2019317ff770b8769b1ec033a0f572a485f64c82ddc8f989e.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/fullcalendar.self-bba8020b43b1564f4971d65d3f02762f706ddfee5754a7d3e38c51e5e74dd319.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/full_calendar.self-2e2a7d8580ce51f27512e0e58dd757b04006fc116b90681a108d350504994b4b.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/jobs_calendar.self-aef6dbaedd824a5c0ede4da9c92d5abbd3951c4570f2f291d6f9dc4736648fce.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/tempusdominus-bootstrap-4.self-bee463c60d2d78e2b844bcb06e7b5c800e08b748021ec8008b78590bccfca48b.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/jquery.qtip.min.self-1d0fe4bf84628829925bd0e18442e0639df3fe1871d9be8b47e9616abd9fd3cb.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/forms.self-04950e7a901af32a1a6ec7b5f1ce4be0256ad5e5c18eeb4659dc05b0941193dd.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/action_cable.self-69fddfcddf4fdef9828648f9330d6ce108b93b82b0b8d3affffc59a114853451.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/cable.self-8484513823f404ed0c0f039f75243bfdede7af7919dda65f2e66391252443ce9.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/channels/notification.self-65c3a6910cd48f1467457b7955e39cc9383be19f1836e409337feb70b9d76a3b.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/channels/pr_notification.self-0f4a682aee347526499f6108912b758ec9c9327afa36502e48b7bca676b64858.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/direct-file-upload.self-2f0039d75f6c4b0b93f1fa8aa657832042bdd96fde9cf4daad0122aa468019a4.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/clients/payments.self-7a2391cabb09a1ee56ff8c5e48494162cd4113afd760df636c49f8a79b9f43df.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/js-routes.self-cdc98628e13d3d821965fc6c6c31b78dd939f0aef74464f53ab31f639034850b.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/clients/timer.self-d0c6304b285d19980bd8a0095508e47b74308cf0195895a546831d1ec21108c6.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/pagy.self-ed1b7aedec3555b39a83babcb2ba4ed72cb140e86128af5a51f9790f2760bcd5.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/application.self-93f041aa0aaf80474a14add3fe5afb1bbe1fb5984f224d3f72e4c4027edbfd01.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/proofreaders/job_countdown.self-2cf6dd4680a28719e76ed9a39006e3a8ff28fb36180927ee99f8a2cb145dcb99.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/chartkick.self-e9487cc6503413bc0fa51025930fcccdf68f1a637ab649419352730501cbd222.js?body=1" data-turbolinks-track="reload"></script>
<script src="/assets/proofreaders/charting.self-c11b3c2c1dcbcfee00f8790ad0c6d809e25c3acc06d376c63964b74a12f3322c.js?body=1" data-turbolinks-track="reload">jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:490)
at Function.each (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:352)
at add_color (charting.self-c11b3c2c1dcbcfee00f8790ad0c6d809e25c3acc06d376c63964b74a12f3322c.js?body=1:153)
at drawBarChart (charting.self-c11b3c2c1dcbcfee00f8790ad0c6d809e25c3acc06d376c63964b74a12f3322c.js?body=1:60)
at Object.success (charting.self-c11b3c2c1dcbcfee00f8790ad0c6d809e25c3acc06d376c63964b74a12f3322c.js?body=1:54)
at fire (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:3269)
at Object.fireWith [as resolveWith] (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:3399)
at done (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:9306)
at XMLHttpRequest.<anonymous> (jquery3.self-5af507e253c37e9c9dcf65064fc3f93795e6e28012780579975a4d709f4074ad.js?body=1:9549)
function isArrayLike( obj ) {
// Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = !!obj && "length" in obj && obj.length,
type = toType( obj );
if ( isFunction( obj ) || isWindow( obj ) ) {
return false;
}
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
关于如何解决此问题的任何想法,还是我可以忽略它?
答案 0 :(得分:0)
希望您已经定义了“ toType”,“ isWindow”和“ isFunction”功能-
function isArrayLike( obj ) {
// Support: real iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
var length = (!!obj && "length" in obj) && obj.length || 0
type = toType( obj );
if ( isFunction( obj ) || isWindow( obj ) ) {
return false;
}
return type === "array" || length === 0 ||
typeof length === "number" && length > 0 && ( length - 1 ) in obj;
}
答案 1 :(得分:0)
我再次查看了我的代码,并按了@CertainPerformances链接后发现了问题。
在以下内容之前,我忘记了“ $”:
if($('#doc-bar-chart').length > 0) {
...
}
大头巴掌