I'm using Jquery to make an AJAX call to a PHP page which outputs JSON with the json_encode function. This PHP page contains javascript code as well, which is sent along with the JSON code, resulting in a JSON parse error. Is there a way to prevent this? Many thanks for your support.

PHP page:
<script type="text/javascript">
//javascript needed on this page
</script>
//json output
$data = array('one'=> 'hello', 'two' => 'world');
echo json_encode($data);