In the top part of my document I have this Jquery code:
// RATING
$('.rateit').click(function(){
var position = $(this).position();
});
In the footer I have a ajax call:
jQuery.ajax({
url: frm.attr('action'), //your server side script
data: frm.serialize(), //our data
type: 'POST',
success: function (data) {
alert(position.left);
},
The problem is that the alert box is not showing with the position. I have tested with alert('something'); and it works fine.
My real ajax call:
jQuery.ajax({
url: frm.attr('action'), //your server side script
data: frm.serialize(), //our data
type: 'POST',
success: function (data) {
$('.warning').fadeIn(500).css({display: 'block',
position: 'absolute',
left: position.left + 50,
top: position.top - 25
}).append('asdasdsadsad'),
$(ri).next('.ratingcount').html('asdasdasd')
},
error: function (jxhr, msg, err) {
alert(msg); //something went wrong.
}
});