Jquery and php

Jquery and php

How can I rewrite my code below if my 'data_select.php' is in a variable $data = dataselect, that when it is set to true the data_select.php will show. I'm making a dynamic content in php and I'm not familiar with jquery. Any idea? thank you in advance.

  1. <script type="text/javascript">
  2.   $(document).ready(function() {
  3.     $('a').click(function(){
  4.       $.get('data_select.php', {'page':$(this).text()}, function(data){
  5.         $('#content').html(data);
  6.       });                         
  7.     });
  8.  });
  9.    </script>