我们可以仅使用 javascript 访问发布/获取数据吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6000186/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 19:05:49  来源:igfitidea点击:

can we acess post/get data using javascript only?

javascriptpostget

提问by Varada

How can we access the variable which is submitted such as

我们如何访问提交的变量,例如

<form methord='get' action='sdsd.html'>

using javascript?

使用javascript?

采纳答案by Bazzz

Values that have been "posted" with GET are now in the querystring. You could parse the querystring with JS to get the values.

已使用 GET “发布”的值现在位于查询字符串中。您可以使用 JS 解析查询字符串以获取值。

Here is a general example: Parse Querystring with JS

这是一个通用示例:Parse Querystring with JS

回答by Gal

POST values are not accessible client side.

POST 值不可访问客户端。

GET values can be accessed via

可以通过以下方式访问 GET 值

window.location.search