I am trying to use a javascript function defined outside of the $(document).ready(function(){}); as the callback for a $.get() request. However, firebug shows:
ReferenceError: temp is not defined
$.get('twitter.php', function(data){temp(data)});
Here's the relevant code:
<script src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="txt/javascript">
function temp(data){
alert(data);
}
</script>
<script>
$(document).ready(function() {
$.get('twitter.php', function(data){temp(data)});
});
</script>
twitter.php
does return data.