ajaxRequest.success 不是 smoothState.js 的函数
ajaxRequest.success is not a function with smoothState.js
我正在尝试将 smoothState.js 实施到自定义 WordPress 主题中,但是当我将鼠标悬停在导航栏上时,我可以看到此错误:
Uncaught TypeError: ajaxRequest.success is not a function
fetch @ jquery.smoothState.js:352
hoverAnchor @ jquery.smoothState.js:539
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
ajaxRequest 似乎不起作用 (jquery.smoothState.js):
ajaxRequest.success(function (html) {
utility.storePageIn(cache, settings.url, html, elementId);
$container.data('smoothState').cache = cache;
});
所以,当我点击更改页面时,我停留在步骤 "is-loading" class,有人可以帮助我吗?
您可能获取了 jQuery 3.0 版,正如文档中所说:http://api.jquery.com/jquery.ajax/
Deprecation Notice: The jqXHR.success(), jqXHR.error(), and
jqXHR.complete() callbacks are removed as of jQuery 3.0. You can use
jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.
如果你使用下面的版本就安全了!
干杯!
我正在尝试将 smoothState.js 实施到自定义 WordPress 主题中,但是当我将鼠标悬停在导航栏上时,我可以看到此错误:
Uncaught TypeError: ajaxRequest.success is not a function
fetch @ jquery.smoothState.js:352
hoverAnchor @ jquery.smoothState.js:539
dispatch @ jquery.min.js:3
q.handle @ jquery.min.js:3
ajaxRequest 似乎不起作用 (jquery.smoothState.js):
ajaxRequest.success(function (html) {
utility.storePageIn(cache, settings.url, html, elementId);
$container.data('smoothState').cache = cache;
});
所以,当我点击更改页面时,我停留在步骤 "is-loading" class,有人可以帮助我吗?
您可能获取了 jQuery 3.0 版,正如文档中所说:http://api.jquery.com/jquery.ajax/
Deprecation Notice: The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callbacks are removed as of jQuery 3.0. You can use jqXHR.done(), jqXHR.fail(), and jqXHR.always() instead.
如果你使用下面的版本就安全了!
干杯!