2011-12-22 49 views
1

更新:感謝您的意見,雖然修復程序無法正常工作。即使在我不包含kjquery.js的所有加載消息仍然打印。我真的很茫然,如果你有更多的建議,請讓我知道!加載jQuery打印「加載」頁

當我包含jQuery的單詞「加載」打印在頁面的所有內容後。我曾嘗試從我自己的服務器和Google API加載它,並且兩次都找到了相同的結果。

這裏的頁面: http://kineticaid.com/k/header.php

而這裏的代碼:

<?php 
include('inc/functions.php'); 
include('inc/titles.php'); 
?> 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> 

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title><?php echo $title; ?></title> 

<link rel="stylesheet" type="text/css" href="css/headerstyle.css"></link> 
<link href="http://fonts.googleapis.com/css?family=Ubuntu|Arimo|PT+Sans:700|Droid+Sans|Nobile|Ovo|Corben:700&v2" rel="stylesheet" type="text/css"></link> 

<script type="text/javascript" src="js/kjquery.js"></script> 

//this is the problem line 
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> 

<script type="text/javascript" src="js/shadowbox/shadowbox.js"></script> 
<script type="text/javascript">Shadowbox.init();</script> 

</head> 

<body> 


<div id="container"> 

    <div id="top"> 
     <?php echo $quote." -".$author; ?> 
    </div> 

很顯然,我沒有關閉任何標籤,但這些都是在footer.php文件。頭文件和頁腳文件都包含在一個home.php文件中,該文件在加載時也會打印單詞「loading」。

+3

你有kjquery.js一個腳本錯誤:地鐵5號線,缺少} – Keith 2011-12-22 22:32:36

+1

'kjquery.js'缺少')'。 – 2011-12-22 22:33:52

+0

「加載」消息當然不是來自jQuery本身。 – Sparky 2011-12-22 22:39:15

回答

1

此加載消息由ShadowBox lightbox插件生成,因爲您在第5行的kjquery.js文件中存在錯誤,並且遺漏了Keith提示的)

只要你解決這個錯誤,所有應該工作。

2
jQuery(document).ready(function($){ 



}); 

get Firebug。你可以在幾秒鐘內找到答案!

0

我對不同的庫有類似的問題。我嘗試加載一個簡單的頁面,並收到頁面底部的「加載」消息。

<html> 
<head> 
    <!-- content for mobile version --> 
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
    <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> 
</head> 
<body class="narrow"> 
    Simple Page 
</body> 
</html> 

搜索了一下後,我發現了一個鏈接,用於連接example that uses mobile swiping,看到移動圖書館還必須包括一個樣式表。 (如果您嘗試此示例並刪除樣式鏈接,則會在輸出中顯示加載消息。)

在包含腳本和消息消失之前包含樣式表。

<link rel="stylesheet" 
    href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css"> 
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> 
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>