[Dojo-interest] IframeTransport POST
Nicolas Antoniazzi
nicolas at orangelogic.com
Thu Jan 25 01:22:15 MST 2007
Thanks james,
I am using a content built with :
var oPostBody = new Object();
oPostBody["var1"] = "value1";
oPostBody["var2"] = "value2";
This process was correctly sent in a post body when I used XMLHTTP. When I
used it with Iframe (exactly the same code except the transport, it sent it
in the URL.
I built a temporary form in my page with hidden field and I used the
formNode method. It fixed the problem. I wil try later to understand why the
first approach did not worked for me.
Thanks again for your answers and your help.
Nicolas.
2007/1/23, James Burke <jburke at dojotoolkit.org>:
>
> What is the value of oPostBody? It should be a JS object, something like:
>
> var oPostBody = {
> name1: value1,
> name2: value2
> };
>
> If it is a string of form-encoded name/value pairs (something like
> "name1=value1&name2=value2", then you should specify "postContent"
> instead of "content":
>
> var oRequest = dojo.io.bind({url: sUrl,
> method: 'POST',
> postCotent: oPostBody,
> //oPostBody = "name1=value1&name2=value2"
> mimetype: "text/html",
> load: this._AjaxSuccess,
> error: this._AjaxFailure
> });
>
> James
>
> On 1/23/07, Nicolas Antoniazzi < nicolas at orangelogic.com> wrote:
> > Thanks for your answer james,
> >
> > I am able to send a POST using a formNode, but it would have been easyer
> for
> > me to only send a content by content.
> > For the formNode method, I will have to dynamically build a form with my
>
> > inputs sine all the values are built on the fly.
> > But if this is the only way to do it, I will.
> >
> > Thanks again,
> >
> > Nicolas.
> >
> > 2007/1/23, James Burke < jburke at dojotoolkit.org>:
> > >
> > > On 1/22/07, Nicolas Antoniazzi <nicolas at orangelogic.com > wrote:
> > > > Hi,
> > > >
> > > > I would like to have the same behaviour when I use the
> IframeTransport
> > and
> > > > XMLHTTPTransport.
> > > > At the moment, I use the XMLHTTPTransport using POST.
> > > >
> > > > I am doing somethink like :
> > > >
> > > > var oRequest = dojo.io.bind({url: sUrl,
> > > > method:
> > > > 'POST',
> > > > content:
> > > > oPostBody,
> > > > mimetype:
> > > > "text/html",
> > > > load:
> > > > this._AjaxSuccess,
> > > > error:
> > > > this._AjaxFailure
> > > > });
> > > >
> > > > I added the transport :
> > > > transport: "IframeTransport",
> > > >
> > > > Now, The content of the Request is sent by URL. I would like to send
> it
> > > > inside a POST (like in forms). Is it possible ? I use the POST
> method
> > but
> > > > dojo does not seems to use it. I saw an example with a formNode but
> I
> > would
> > > > not like to create all the DOM content in my page to send values. is
> it
> > > > possible to only use the oPostBody as Form Content ?
> > > >
> > > > Thanks
> > > >
> > > > Nicolas.
> > >
> > > I'm not sure I follow, but the iframe transport can do posts using
> > > form data. Here is an example (uses 0.4.1 rc code, but iframetransport
> > > hasn't changed):
> > >
> > http://www.tagneto.org/dojo/0.4.1rc1/tests/io/test_IframeIO.html
> > >
> > > James
> _______________________________________________
> Dojo FAQ: http://dojo.jot.com/FAQ
> Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
> Dojo-interest at dojotoolkit.org
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070125/64132812/attachment-0001.html
More information about the Dojo-interest
mailing list