gpt4 book ai didi

jquery - 未捕获的类型错误 : Cannot read property 'webkit' of undefined

转载 作者:行者123 更新时间:2023-12-03 22:43:18 28 4
gpt4 key购买 nike

我正在研究 Ruby on Rails 教程第 8 章中的示例,但我的页面上出现上述错误,并且我的下拉菜单不起作用。关于如何解决这个问题有什么想法吗?

/* ===================================================
* bootstrap-transition.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#transitions
* ===================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================== */


!function( $ ) {

$(function () {

"use strict"

/* CSS TRANSITION SUPPORT (https://gist.github.com/373874)
* ======================================================= */

$.support.transition = (function () {
var thisBody = document.body || document.documentElement
, thisStyle = thisBody.style
, support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined

return support && {
end: (function () {
var transitionEnd = "TransitionEnd"
if ( $.browser.webkit ) {
Uncaught TypeError: Cannot read property 'webkit' of undefined
transitionEnd = "webkitTransitionEnd"
} else if ( $.browser.mozilla ) {
transitionEnd = "transitionend"
} else if ( $.browser.opera ) {
transitionEnd = "oTransitionEnd"
}
return transitionEnd
}())
}
})()

})

}(window.jQuery);

最佳答案

我认为问题就在这里:$.browser.webkit - 显然 $.browser 已在 jQuery 1.9+ 中删除。

根据this thread没有直接替换,但是可以使用 this plugin您应该能够恢复该标记的功能。

关于jquery - 未捕获的类型错误 : Cannot read property 'webkit' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15116745/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com