jQuery文件(jquery-1.11.3.min.js)加载多次(4)次。我想我知道这是因为index.html页面中的下面的jquery文件。我不知道的是如何阻止它。jquery文件加载多次
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.mobile-1.4.5.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
任何建议将非常感激。
我刚刚创建了一个演示页像下面在VS,我可以看到jQuery的1.11.3.min.js的4个实例在VS解决方案的窗口。 我认为这个问题只是在Visual Studio中,似乎浏览器的开发人员工具只显示了jquery-1.xx.js文件的一个实例。 对不起,造成的不便。
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Demo</title>
<script type="text/javascript" src="G5 - KA/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="G5 - KA/js/jquery-ui.min.js"></script>
<link rel="stylesheet" href="G5 - KA/css/jquery-ui.min.css" />
<script type="text/javascript" src="G5 - KA/js/jquery.mobile-1.4.5.min.js"></script>
<link rel="stylesheet" href="G5 - KA/css/jquery.mobile-1.4.5.min.css" />
<script type="text/javascript" src="G5 - KA/js/jquery.dataTables.min.js"></script>
</head>
<body>
<p>This is just jquery test</p>
</body>
</html>
没有那些加载的jQuery v1.11.3在所有的做任何事情。 –
我们将需要看到更多的页面。在浏览器和查看源上点击它,以确保您看到浏览器实际正在处理的内容。 – n8wrl
在这三个之前添加'jquery'并确保您使用兼容版本。 –