[whatwg] Forms and POST'ing to data: URL's

Hello Ian,

One use case, from my point-of-view, was to allow for non-networked form
submits

For example, if you had a computer or device that did NOT have a network
connection, and you did not have (and did not want to have or cannot have) a
local  HTTP server running.  Then you could use such a data URL to make
things happen.

Also, with the use of data URL's for <img>'s, for <object>'s, and for
<form>'s, you could have an entire HTML-based application contained in
exactly one file.

Which is again useful in situations where you do NOT have network access.

Also, it is useful to have the entire HTML-based application contained in
"one file" when you want to put it into some other XML document.  (Like in
RSS, Atom, or XMPP/Jabber.)


What really motivated me to think about it is that is that I was writing a
blog post about how to create HTML e-mail signatures with hCards built into
them.

I wanted to include a form to help them do this.  The reader would fill in
their name, e-mail address, etc, and it would generate HTML code they could
use for their HTML e-mail signature.

However, I didn't want the form to make a request back to my server.
(Because people could be reading this in their feed reader were they have
the blog post cached from my feed.)  I wanted it to be entirely self
contained within the blog post.

So, as you mentioned, one solution is JavaScript.  However, JavaScript has a
couple problem.  #1: It complex.  (Yes... I'm lazy :-)  )  #2: Not all blog
readers will allow the execution of JavaScript.

Also,... another reason against making a call on my server....  The blogging
software I wrote works by having each blog post be a file.  Each file is an
Atom document.  Not an Atom <feed> though.  But an Atom <entry>.  (And yes,
it is legal to have an Atom <entry> as the root element.)

So having everything in one file is easier and simpler for me.  (And again,
yes, I'm lazy, and like things easy.)  Preferably, I'd like to do <form>'s,
<img>'s, and <object>'s with data URL's.


See ya

On 8/24/06, Ian Hickson <ian at hixie.ch> wrote:
>
> On Wed, 26 Jul 2006, Charles Iliya Krempeaux wrote:
> >
> > <form method="POST" action="### DATA URL HERE ###">
> >    <input type="text" name="given_name" />
> >    <input type="text" name="family_name" />
> >    <input type="submit" value="generate letter" />
> > </form>
> >
> > How would you get the value of "given_name" and "family_name" into the
> > data URL?
>
> You can't, unless you use JavaScript, I think.
>
>
> > What I want is something like...
> >
> > <form method="POST" action="data:,To whom it may concern.  My give name
> is
> > '%%{given_name}' and my family name is '%%{family_name}'.  Sincerely,
> > %%{given_name} %%{family_name}">
>
> Interesting. What's the actual use case? I hadn't really envisaged data:
> being used for anything but debugging.
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>



-- 
    Charles Iliya Krempeaux, B.Sc.

    charles @ reptile.ca
    supercanadian @ gmail.com

    developer weblog: http://ChangeLog.ca/
___________________________________________________________________________
 Make Television                                http://maketelevision.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20060824/03adea05/attachment.htm>

Received on Thursday, 24 August 2006 19:06:07 UTC