phonegap form submission to remote server

前端 未结 1 747
暖寄归人
暖寄归人 2021-01-14 06:59

Here\'s my problem: I have a form in index.html, it will have a text input, and the value will be $.post to a php page that should process it and will return a value. My cod

相关标签:
1条回答
  • 2021-01-14 07:24

    A few points:

    1. Add the remote server to the whitelist...if you are using blackberry ou must edit the config.xml file, if is a ios app, you must change the plist file of the project.

    EDIT 2011-11-03: In Android: Make sure this line is in phonegap app manifest file: < uses-permission android:name="android.permission.INTERNET">

    2. Try adding this header to the php file header('Access-Control-Allow-Origin: *');

    EDIT 2011-11-03: this header must be included on the beginning of the PHP file.

    1. $('#result').html(output).show(); the show method is not necesary, you must use that only if the field has the hidden attribute.

    Good Luck!

    0 讨论(0)
提交回复
热议问题