我正在使用this jQuery star rating plugin
但是,您在哪里添加指向数据库中插入数据的PHP文件的链接?
答案 0 :(得分:1)
这是需要做的事情:
$('input.wow').rating({
callback: function(value){
$.ajax({
type: 'GET',
url: "http://www3.inrees.com/rating_films_ajax.php?action=voter",
data:"films_id=<?php echo $id; ?>&rating="+value,
success: function(){
alert(value);
}
})
}
})
问题回答,我的中指指向插件的构想者
答案 1 :(得分:0)
检查页面源代码:似乎没有文件指定:它是一个简单的HTML表单:
<form name="api-select">
<span class="star-rating-control">
<div class="rating-cancel"><a title="Cancel Rating"></a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live star-rating-on"><a title="A">A</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live star-rating-on"><a title="B">B</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live star-rating-on"><a title="C">C</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live"><a title="D">D</a></div>
<div class="star-rating rater-0 star star-rating-applied star-rating-live"><a title="E">E</a></div>
</span>
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="A" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="B" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="C" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="D" type="radio">
<input style="display: none;" class="star star-rating-applied" name="api-select-test" value="E" type="radio">
<input value="Submit »" onclick="$(this).next().html( $(this.form).serialize() || '(nothing submitted)' );" type="button">
</form>
因此,我认为您应该只在表单元素上设置action
和method
属性。