使用 POST 方法将参数发布到 url 而不使用表单 [英] Posting parameters to a url using the POST method without using a form

查看:34
本文介绍了使用 POST 方法将参数发布到 url 而不使用表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 POST 方法将参数发布到 URL,但我无法使用表单.即使我确实使用了表单,它也必须在没有用户交互的情况下自动发布.这可能吗?我该怎么做?

I want to post parameters to a URL using the POST method but I cannot use a form. Even if I do use a form, it would have to be auto-posted with out user interaction. Is this possible? How can I do this?

推荐答案

您可以使用 JavaScript 和 XMLHTTPRequest (AJAX) 来执行 POST,而无需使用表单.检查此链接.请记住,您需要在浏览器中启用 JavaScript.

You could use JavaScript and XMLHTTPRequest (AJAX) to perform a POST without using a form. Check this link out. Keep in mind that you will need JavaScript enabled in your browser though.

这篇关于使用 POST 方法将参数发布到 url 而不使用表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆