tags:

views:

23

answers:

2

If I wanted to do a GET request I could just use document.location = "what-ever-I-want". But how do I do that with YUI?

I was told that I can't do it with YUI 2 Connection Manager and afaik I really can not. Then I was told that I can do it with YUI 3, but in trying to do so I've not found the answer and I'm thinking I really can't.

Please notice that I DON'T want to use Ajax, but a regular post.

I need this to make a link send a POST request, instead of GET.

[b]I know I can work around creating a form with JS and I'm doing that right now, but isn't there a more cleaner way?[/b]

A: 

Create a form making sure to set

method="post"

then insert it into the document, get a reference to it & call

.submit()

on it.

Tivac
A: 

Tivac answer is the way to go.

I've discussed about this with him and some other people on #yui channel on freenode and yes, what he said is what we should be doing.

I've decided to open a feature request ticket for this to be implemented on YUI. You can check it out at http://yuilibrary.com/projects/yuilibrary/ticket/2528278

This might be of interest: http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit

Henrique Vicente