2015-10-15 68 views
-4

当我插入这个脚本的链接在我的index.phpjquery脚本链接是bug?

<script src="//code.jquery.com/jquery-1.10.2.js"></script> 
 
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

它变成这个..

enter image description here

这是它normaly样子和应该看起来像

enter image description here

这里是整个代码

<!DOCTYPE html> 
 

 
<html lang="en"> 
 

 
<head> 
 

 
    <meta charset="utf-8"> 
 
    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
 
    <meta name="viewport" content="width=device-width, initial-scale=1"> 
 

 
    <title> 
 
\t \t <?php include ('title.php');?> 
 
\t </title> 
 
\t 
 
    \t <link rel="icon" href="assets/img/LOGO.png"> \t 
 

 
\t <link href="assets/css/bootstrap.css" rel="stylesheet"> \t 
 
\t <link href="assets/css/bootstrap.min.css" rel="stylesheet"> 
 
\t <link href="assets/css/plugins/metisMenu/metisMenu.min.css" rel="stylesheet"> 
 
\t <link href="assets/css/custom.css" rel="stylesheet"> 
 
\t <link href="assets/font-awesome-4.1.0/css/font-awesome.min.css" rel="stylesheet" type="text/css"> 
 
\t <link href="assets/css/jquery.dataTables.min.css" rel="stylesheet" type="text/css"> 
 
\t <link rel="stylesheet" href="/resources/demos/style.css"> 
 
\t <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> 
 
\t 
 
\t </head> 
 
<body> 
 
\t <div id="wrapper"> 
 
\t \t <?php 
 
\t \t \t session_start(); \t 
 
\t \t \t include ("checkSession.php"); 
 
\t \t \t include ("nav.php"); 
 
\t \t \t include ("pagecontent.php"); 
 
\t \t ?> 
 
\t </div> 
 
\t 
 

 
\t 
 
\t <script src="assets/js/jquery.js"></script> 
 
    <script src="assets/js/bootstrap.min.js"></script> 
 
    <script src="assets/js/plugins/metisMenu/metisMenu.min.js"></script> 
 
    <script src="assets/js/custom.js"></script> 
 
    <script src="assets/js/jquery.dataTables.min.js"></script> 
 
\t <script src="assets/js/jquery-1.3.2.min"></script> 
 
\t 
 
\t <script> 
 
\t \t $(document).ready(function(){ 
 
\t \t \t $('#listTable').DataTable(); 
 
\t \t }); 
 
\t </script> 
 
\t <script> 
 
\t \t $(document).ready(function(){ 
 
\t \t \t $('#print').DataTable({ 
 
     "paging": false, 
 
     "filter": false, 
 
     "info":  false 
 
    }); 
 
\t \t }); 
 
\t </script> 
 
\t <script language="javascript"> 
 
\t function Clickheretoprint() 
 
\t { 
 
\t var disp_setting="toolbar=yes,location=no,directories=yes,menubar=yes,"; 
 
\t \t disp_setting+="scrollbars=yes,width=1000, height=400, left=100, top=25"; 
 
\t var content_vlue = document.getElementById("content").innerHTML; 
 
\t 
 
\t var docprint=window.open("","",disp_setting); 
 
\t docprint.document.open(); 
 
\t docprint.document.write('</head><body onLoad="self.print()" style="width: 1500px; font-size:11px; font-family:arial; font-weight:normal;">');   
 
\t docprint.document.write(content_vlue); 
 
\t docprint.document.close(); 
 
\t docprint.focus(); 
 
\t } 
 

 

 
\t </script> 
 
    <script src="//code.jquery.com/jquery-1.10.2.js"></script> 
 
    <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
 
\t <script> 
 
    $(function() { 
 
    $("#from").datepicker({ 
 
     defaultDate: "+1w", 
 
     changeMonth: true, 
 
     numberOfMonths: 1, 
 
     onClose: function(selectedDate) { 
 
     $("#to").datepicker("option", "minDate", selectedDate); 
 
     } 
 
    }); 
 
    $("#to").datepicker({ 
 
     defaultDate: "+1w", 
 
     changeMonth: true, 
 
     numberOfMonths: 1, 
 
     onClose: function(selectedDate) { 
 
     $("#from").datepicker("option", "maxDate", selectedDate); 
 
     } 
 
    }); 
 
    }); 
 
    </script> 
 
    </script> 
 

 
\t 
 

 

 

 

 
</body> 
 

 
</html>

那么如果我删除脚本的链接,并把在其他源代码,它不工作,所以我真的很需要那脚本链接运行功能:(

回答

-2

我相信这是因为用于访问jQuery的CDN的协议。试试这个:

<script src="http://code.jquery.com/jquery-1.10.2.js"></script> 
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 

,如果不行,请尝试使用HTTPS:

<script src="https://code.jquery.com/jquery-1.10.2.js"></script> 
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> 
+0

没有错的协议。 – ceejayoz

3

你双(实际上,三联)包括jQuery的。

<script src="assets/js/jquery.js"></script> 
<script src="assets/js/jquery-1.3.2.min"></script> 
<script src="//code.jquery.com/jquery-1.10.2.js"></script> 

很可能在你的jQuery 1.3.2兼容的代码中的一些东西,在jQuery的1.10.2不工作(这是加载的最后一个版本,覆盖等)。检查你的控制台的脚本错误。

您可以在页面上使用jQuery.noConflict来使用多个版本的jQuery,但是您真的可以更好地解决更基本的问题。

0

我现在知道了,我只是需要将其修改成

<script src="assets/js/jquery-1.10.2.js"></script> 
 
<script src="assets/js/jquery-ui.js"></script>