开发者

How do I make an non-ajax POST request with YUI javascript library?

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 d开发者_开发技巧o 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]


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 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: JavaScript post request like a form submit

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜