Android HTML5在浏览器中提交表单

时间:2016-02-01 03:53:54

标签: javascript android jquery html5 cordova

我想知道如何将表单提交到手机浏览器中,因为它会打开指向同一个应用程序的链接。我已经安装了cordova inappbrowser并尝试了下面的示例代码,没有运气。

<form action="http://www.random.link" method="POST" target="_blank"><input type="submit" id="sb" value="Submit"></form>

我做了一些搜索,但只找到了如何在手机的浏览器中打开链接,而我想在提交表单时这样做。

1 个答案:

答案 0 :(得分:0)

如果您的意思是说在Android应用中您要提交表单,则需要使用webview,如下所示 http://developer.android.com/reference/android/webkit/WebView.html

确保您在html中创建的表单应具有方法get 使用以下加载您的HTML webView.loadDataWithBaseURL(“file:///android_asset/index.html”,htmlfilecontent,“text / html”,“UTF-8”,null);

相关问题