problem to make ajax with jquery and play framework
Hi, I am starting to use ajax with jquery with the play framework but i
have some difficulties to make my stuff working. I hope you will help
me. Here the problem :
- $(function(){
- $("a").mouseover(function() {
if($(this).attr("title") == "") return false;
$("body").append('<span class="infobulle"></span>');
var bulle = $(".infobulle:last");
//bulle.append($(this).attr("title"));
$(this).attr("title","");
- $.getJSON('../../ajaxrequests/getdescriptif', function(descriptif) {
- alert("test");
- });
- var posTop = $(this).offset().top - $(this).height();
var posLeft = $(this).offset().left + $(this).width()/2 -
bulle.width()/2;
bulle.css({
left:posLeft,
top:posTop-10,
opacity:0
});
bulle.animate({
top:posTop,
opacity:0.99
});
});
- $("a").mouseout(function() {
var bulle = $(".infobulle:last");
$(this).attr("title",bulle.text());
if(bulle.offset() == null) return false;
bulle.animate({
top:bulle.offset().top + 10,
opacity:0
},200,"linear",function(){bulle.remove();}
);
});
- });
The problem is that all the stuff in my .getJSON is no working like
the alert. But in firebug i have :
GET http://localhost:9000/ajaxrequests/getdescriptif 200 OK 52ms
Reponse : truc
truc is the String i send in getDescriptif so it work but i can't do
anything with this.
I have no error javacripts and the rest of the code works.
Just the code in getJSON dont work
- $.getJSON('../../ajaxrequests/getdescriptif', function(descriptif) {
- alert("test");
- });
If someone can explain to me why i will appreciate.