我有更新到 5.5 版的 WordPress 网站
现在我得到错误:
Uncaught TypeError: Cannot read property 'msie' of undefined
at jquery.tools18.min.js?ver=10.2.2:281
at jquery.tools18.min.js?ver=10.2.2:358
(index):738 Uncaught TypeError: $(...).live is not a function
at HTMLDocument.<anonymous> ((index):738)
at i (jquery.js?ver=1.12.4-wp:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4-wp:2)
at Function.ready (jquery.js?ver=1.12.4-wp:2)
at HTMLDocument.J (jquery.js?ver=1.12.4-wp:2)
我尝试应用此修复程序:
https://bootstrapcreative.com/uncaught-typeerror-cannot-read-property-msie-of-undefined/
通过将其添加到我使用的模板的 header.php 中:
<!doctype html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="profile" href="https://gmpg.org/xfn/11" />
<?php wp_head(); ?>
<script>
jQuery.browser = {};
(function () {
jQuery.browser.msie = false;
jQuery.browser.version = 0;
if (navigator.userAgent.match(/MSIE ([0-9]+)\./)) {
jQuery.browser.msie = true;
jQuery.browser.version = RegExp.$1;
}
})();
</script>
</head>
但它不起作用。我犯了同样的错误。你知道我该如何解决这个问题吗?