如何在加载jQuery之前阻止点击事件上的链接?
原因是我有很少的链接通过jQuery ajax函数调用AJAX,如果用户在加载jQuery框架之前单击它们,浏览器无法触发jQuery ajax函数并将跟随链接href ="..."谢谢.
编辑:我可以用这个吗?
<head>
...
<script type="text/javascript">
window.onload = prevCl();
function prevCl() {
var links = document.links[];
links.onclick = check();
}
function check() {
if (typeof jQuery == 'undefined') {
return false;
}
}
</script>
</head>
Run Code Online (Sandbox Code Playgroud)