如何在 JavaScript 中访问请求内容正文中的查询参数?

发布于 2024-07-09 23:44:24 字数 123 浏览 4 评论 0原文

如果我使用 GET 请求页面,那么我可以使用 window.location.search 从 javascript 访问任何查询参数。 当页面是 POST 结果时,是否有类似的方法来访问请求内容正文中而不是请求位置中的查询参数?

If I use a GET to request a page, then I can access any query parameters from javascript using window.location.search. Is there a similar way to access query parameters which are in the request content body rather than the request location, when the page is a result of a POST?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

空城之時有危險 2024-07-16 23:44:24

因为数据是在服务器端处理的,所以客户端(JS 所在的地方)无法访问这些变量。

Because the data is being handled on the server side, the client (where JS lives) has no access to these variables.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文