I am trying to use a javascript function defined outside of $ (document) .ready (function () {}); as a callback to request $ .get (). However, firebug shows:
ReferenceError: temp is not defined $.get('twitter.php', function(data){temp(data)});
Here is 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 returns data.
source share