html - 如何在 react-native 中通过 webview 提交 html 表单
问题描述
我通过 fetch 在 react-native 中获得了一个网页。网页是这样的:
<html><body onload="document.forms[0].submit();"><form action='XXX' method="post"><input type="hidden" name="keywords" value='hello' /></form></html>
. 那么我怎样才能在 react-native 中发布这个网页呢?
解决方案
由 WebView 解决。像这样:
<WebView source={{html:'<html><body onload="document.forms[0].submit();"><form action='XXX' method="post"><input type="hidden" name="keywords" value='hello' /></form></html>
'}}></WebView>.
推荐阅读
- c++ - 初始化自定义类 C++ 的二维数组
- ajax - 抛出异常:大文件上传 ASP.Net 核心上 System.Private.CoreLib.dll 中的“System.IO.InvalidDataException”
- html - 如何为选项创建多个选项
- python - 'dict' 对象没有属性 'META' 重定向错误
- postman - 邮递员将标题添加到上传的文件
- php - Functions.php 从 wordpress 仪表板返回消息
- java - Firebase 嵌套快照
- amazon-web-services - VSCode 调试器在本地调试 AWS Lambda 时无法解析不存在的文件
- python - python中的非重叠节点?
- python - 将字典值映射到熊猫数据框中的列表