Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7179487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:08:59+00:00 2026-05-28T17:08:59+00:00

I am using the following technologies: – jQuery Mobile 1.0.1 – Phonegap 1.3.0 –

  • 0

I am using the following technologies:
– jQuery Mobile 1.0.1
– Phonegap 1.3.0
– Xcode 4.2

When I try to submit form data to a remote server, I get success using the application through the browser.

When I try to submit form data to a remote server using the application natively, I can not send.

I need some plugin PhoneGap?
I need some setup Xcode?

The following sample code was run on the iPhone Simulator 5.0:

<html> 
<head> 
    <title>Page Title</title> 
    <link rel="stylesheet" href="scripts/jquery.mobile-1.0.min.css" />
    <script type="text/javascript" src="scripts/jquery.js"></script>
    <script type="text/javascript" src="scripts/jquery.mobile-1.0.min.js"></script>

    <script>
        $(document).ready(function() {
                $('#loginForm').submit(function() {
                            $('#output').html('Connecting....');
                            var postTo = 'http://myserver/login.php';

                            $.post(postTo,{username: $('[name=username]').val() , password: $('[name=password]').val()} , 
                                function(data) {

                                if(data.message) {
                                    $('#output').html(data.message);
                                } else {
                                    $('#output').html('Could not connect');
                                }

                                },'json');

                return false;
                });
        });
        </script>

    </head> 

    <body> 

        <!-- Start of first page -->
        <div data-role="page" id="foo">

            <div data-role="header">
                <h1>Foo</h1>
            </div><!-- /header -->

            <div data-role="content">   

                <p id="output"></p>

                <form method="post" id="loginForm">
                Username: <input type="text" name="username"> <br /> <br />
                Password: <input type="password" name="password"> <br />

                <input type="submit" value="Login">

                </form>


            </div><!-- /content -->

            <div data-role="footer">
                <h4>Page Footer</h4>
            </div><!-- /header -->
        </div><!-- /page -->


    </body>

</html>

In my server: (login.php)

    <?php
    if(isset($_POST['username']) and isset($_POST['password'])) {

            if ($_POST['username'] == 'test' and $_POST['password'] == 'test') {

            $data['success'] = true;
            $data['message'] = 'Login succesful';

            } else {

            $data['success'] = false;
            $data['message'] = 'Login failed';

            }

        // return json
        echo json_encode($data);

        }
?>

Does anyone have any idea how to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:09:00+00:00Added an answer on May 28, 2026 at 5:09 pm

    Both PhoneGap and jQuery Mobile examples use AJAX request not $.post.

    This blog entery uses $.ajax and jQuery Mobile
    http://www.giantflyingsaucer.com/blog/?p=1948

    This this other one uses a XMLHttpRequest:
    http://wiki.phonegap.com/w/page/42450600/PhoneGap%20Ajax%20Sample

    Hopefully that gets you pointed in the right direction.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using following code I try to get updated list of checkbuttons' corresponding text values,
I am writing an MMO Server using the following technologies and languages: .Net Framework
I have a spring MVC application using JSP as my view technologies with Jquery
We have a web application using the following technologies: JSF 2.0, EJB 3.1, JPA
Using following regexp I can get if a string starts with a or b
I using following code: var search = 'test'; if ($('#sku').find(search) ){ //alert(search); $(document).find(search).css('color','red'); <TABLE>
I am using following code to handle all the unhandled exceptions in the program.
I am using following code to remove some specific nodes from xml file..It show
I am using following PHP code to connect to MS Access database: $odb_conn =
I am using following storedprocedure set ANSI_NULLS ON set QUOTED_IDENTIFIER ON GO Alter PROCEDURE

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.