Jquery variable not set
<p>In the top part of my document I have this Jquery code:</p>

<pre><code>// RATING 
$('.rateit').click(function(){
var position = $(this).position();
});
</code></pre>

<p>In the footer I have a ajax call:</p>

<pre><code>  jQuery.ajax({
             url: frm.attr('action'), //your server side script
             data: frm.serialize(), //our data
             type: 'POST',
             success: function (data) {
            alert(position.left);
            },
</code></pre>

<p>The problem is that the alert box is not showing with the position. I have tested with <code>alert('something');</code> and it works fine. </p>

<p>My real ajax call:</p>

<pre><code> 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.
     }
 });
</code></pre>
