[jQuery] Ajax Problem
[jQuery] Ajax Problem
hi all,
I have 2 file
rating.js
$(document).ready(function() {
var behav = function(){
$(".rating_class").hover(function(){
$("#tooltip_star").css({"visibility":"visible", "top":($
(this).offset().top - 60), "left":($(this).offset().left+$(this).width
()+ 2)});
$.ajax({
type: "POST",
url: $(this).attr("href"),
success: function(msg){
$("#tooltip_star").html(msg);
}
});
}, function(){
$("#tooltip_star").css("visibility","hidden");
}).ajaxStart(function(){
$("#tooltip_star").html("<table class=\"table_animation
\"><tr><td><img style=\"text-align:center\" src=\"/resource/images/
loading.gif\"></td></tr></table>");
});
$(".rating_class").click(function(){
location = $(this).attr("href").replace("ajax_", "");
return false;
});
}
behav();
});
there is just call function behav(); to run all sintax in this file,
and i have some ajax sintax in other file file this
$(document).ready(function() {
var mainApp = function(page){
$.ajax({
type: "POST",
url: "<?= base_url();?>product/related/<?= $idProduct ?