2011-03-21 125 views
3

所以我有這個插件http://www.myjqueryplugins.com/jRating 我下載它,並嘗試了一個新的空白頁面上只是爲了看看我能做到這一點。有效。現在 的問題是我把這個插件在我的網站和我在空白頁沒有做確切的事情,但這次的插件無法正常工作。是因爲我在實際網站上使用了原始的jQuery功能嗎? 廣東話網上上傳我的所有文件..但這裏是重要的部分jQuery插件不工作

這是進口

<!-- styles --> 
<link rel="stylesheet" type="text/css" href="styles/general.css"/> 
<link rel="stylesheet" type="text/css" href="styles/place-event.css"/> 
<link rel="stylesheet" type="text/css" href="styles/homepage.css"/> 
<link rel="stylesheet" type="text/css" href="styles/css-buttons.css"/> 
<link rel="stylesheet" type="text/css" href="styles/colors.css"/> 

<!-- plugin jRate --> 
<link rel="stylesheet" type="text/css" href="plugin/jrate/jquery/jRating.jquery.css"/> 
<script type="text/javascript" src="plugin/jrate/jquery/jRating.jquery.js"></script> 

<!-- scripts --> 
<script type="text/javascript" src="scripts/removeTextClick.js"></script> 
<script type="text/javascript" src="scripts/jquery-1.4.4.min.js"></script> 

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script> 

這是jQuery代碼

<script type="text/javascript"> 

$(document).ready(function(){ 

    $("#abso").hide(); 
    $("#close").hide(); 


    $("#places-feed").load("eventPictures.html"); 
    $("#comments").load("commentsOnEvent.html"); 
    $("#insert-activity").load("newsFeed.html"); 
    $("#list-friends-feed-link").load("friendsCount.html"); 
    $("#notify").load("notificationCount.html"); 
    $("#list-groups-feed-link").load("groupsCount.html"); 


    $("#list-friends-feed-link").click(function(){ //start click 

     $("#abso").load("listFriendsFeed.html"); 
     $("#abso").slideDown("600", function(){}); 
     $("#close").slideDown("600", function(){}); 

    }); //end click 

    $("#list-pictures-feed-link").click(function(){ //start click 

     $("#abso").load("picFeed.html"); 

     $("#abso").slideDown("600", function(){}); 
     $("#close").slideDown("600", function(){}); 
    }); //end click 

    $("#list-groups-feed-link").click(function(){ //start click 

     $("#abso").load("listGroupsFeed.html"); 

     $("#abso").slideDown("600", function(){}); 
     $("#close").slideDown("600", function(){}); 
    }); //end click 

    $("#notify").click(function(){ //start click 

     $("#abso").load("notifications.html"); 

     $("#abso").slideDown("600", function(){}); 
     $("#close").slideDown("600", function(){}); 
    }); //end click 

    $("#upload-pic-place-gallery").click(function(){ //start click 

     $("#abso").load("uploadPicPlaceGallery.html"); 

     $("#abso").slideDown("600", function(){}); 
     $("#close").slideDown("600", function(){}); 
    }); //end click 

    $("#close").click(function(){ //start click 

     $("#abso").slideUp("600",function(){}); 
     $("#close").slideUp("600",function(){}); 
    }); //end click 


    // this block is for jRate plugin 

    $(".ratings").jRating(); 

    // --- 



}); 


</script> 

最後,這是一些代碼是包括插件使用的html中的div

<div id="the-place-event-div"> <!-- the place event div start --> 

<div id="for-top-box"> <!-- for top box start --> 
<a> 
<img src="images/welcome.png"/> 
</a> 

<div id="place-description"><p>where awesomeness meets awesome</p> <!-- place description start --> 
<p id="date-time">Date:<a>21/08/2010</a> Time:<a>07:00am</a></p> 

<div class="ratings" data="12_1"> <!--rating div start --> 



</div> <!-- ratings div end --> 



</div> <!-- place description end --> 



</div> <!-- for top box end --> 
+1

你能鏈接到你的網站或內應*工作,但頁面不?我們無法從模糊的問題中靈感地提取有用的信息(還)。 – Blender 2011-03-21 06:54:14

+0

你是否收到任何腳本錯誤?如果您使用Firefox,請檢查FireBub控制檯是否顯示任何錯誤。 – rahul 2011-03-21 07:01:13

+0

@Blender我添加的代碼 – Kay 2011-03-21 07:05:39

回答

10

p問題在於你在引用jQuery文件之前添加了對插件的引用。

<script type="text/javascript" src="scripts/jquery-1.4.4.min.js"></script> 
<script type="text/javascript" src="plugin/jrate/jquery/jRating.jquery.js"></script> 

這應該有效。

+0

感謝名單,它的工作:) ..但現在的問題是它沒有顯示圖標的星星。它只能顯示一個黃色條 – Kay 2011-03-21 07:17:51

+0

您可能沒有將圖像放在正確的目錄中。請使用Firebug Net標籤檢查您是否收到404錯誤。 – rahul 2011-03-21 10:11:11

+0

明白了。它工作:) Thanx – Kay 2011-03-24 12:29:35