Window object as Global Variables Inside Function always undefined
<p>Hi I dont know what I'm missing but if its always says undefined.</p>

<pre><code>function report_grid() {
$.ajax({
    type: "POST",
    url: "filter_option.php?action=filter",
    data: $('#form1').serialize(),
    async: false,
    success: function(rdata) {
        window.my_var = rdata
    }
})
}
$('#onscreen').click(function() {
    alert(my_var);
    return false;
})
</code></pre>

<p>All my searches to googles shows that this should work, any idea why its not working.</p>
