我正在尝试向我的网站添加页面转换。但由于某些原因,当我点击它重定向一个链接mywebsite.com/undefinedJavascript页面转换undefined
这是我使用
jQuery(document).ready(function($) {
$('.menu-item').click(function(event) {
event.preventDefault();
newLocation = this.href;
$('.preloader').fadeIn(1000, newpage);
});
function newpage() {
window.location = newLocation;
}
});
的代码我无法得到它的工作。任何帮助,将不胜感激。
你没有将新位置传递给你的函数 –