So current setup is as following:
PHP:data.php
You can use a hidden field:
And then you can parse the input value from javascript:
var data = $.parseJSON($('#my-data').val());