W3C home > Mailing lists > Public > public-html-comments@w3.org > April 2013

Feature Request: Script data headers

From: C Havemann <thecmann1@gmail.com>
Date: Tue, 23 Apr 2013 00:49:17 +0200
Message-ID: <CAH1-2D7x9S6oH4naM7EWy-KRfvaxtdUjUUErAxQK7HRYKW9eMg@mail.gmail.com>
To: public-html-comments@w3.org
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:04:15 UTC