javascript - 是否可以将输入的值从我的网站传递到互联网上的任何其他网站
问题描述
是否可以将输入的值从我的网站传递到互联网上的任何其他网站。我已将输入保存到本地存储。现在我想将它传递到另一个需要用户名的网站。另一个网站的输入 ID="userusername"。如果网站不期望使用例如 POST 或 GET 方法发布的值,是否有可能?
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<script type="text/javascript">
function passvalues(){
var pass=document.getElementByID("name").value;
localStorage.setItem("textvalue", pass);
return false;
}
</script>
<form method="POST" action="whatever website">
<input type="name" placeholder="Name" id="name"/>
<input type="submit" placeholder="Login" onclick="passvalues();"/>
</form>
</body>
</html>
解决方案
LocalStorage 仅限于指定页面的协议,因此您可以使用 post 方法将本地存储的数据传递到另一个网站。但是,如果您的页面协议发生变化,情况就不会如此。
推荐阅读
- php - 在 php 中使用谷歌广告 api 进行分页
- python - 将给定 python 代码中的所有导入作为字符串列出
- jmeter - 从jmeter中的json blob中仅提取相关项目
- flutter-http - 为什么我在使用 Flutter Post 方法时收到此错误
- node.js - 错误:未能在 heroku 中推送一些参考
- reactjs - 为什么 Apollo 客户端在缓存注册成功后不会重新渲染 UI?
- php - json数据,获取最低价格,但不知道父标签
- python - “无法获取区域”(新错误(“NO_RESULT”,“resource://gre/modules/Region.jsm”,376))错误使用 GeckoDriver 和 Firefox 通过 Selenium
- python - 当您遇到 BadZipFile 时是否可以继续?
- mongodb - 猫鼬慢速选择不在模型中的特定字段