Feature Request: Script data headers

Currently if you want to send data from the server to the client side
script you have output a script tag, for example in PHP:

> <?php
>     $data = 'value';?><script type="text/javascript">
>     var data = <?php echo data ; ?>;</script>
>
> Which works but somehow doesn't seem right to me.
I would imagine something that works like POST data except in reverse.
The data is sent back in the response headers and the browser would process
the data to return it in nice usable format
Maybe it could be accessed in javascript something like this:

> var name = responseData['name'];
> var person1 = responseData['people'][0];
> var person2 = responseData['people'][2];
>
>

Received on Tuesday, 23 April 2013 05:48:51 UTC