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 8772631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:04:59+00:00 2026-06-13T18:04:59+00:00

I have a Phonegap app that needs to post data to a remote server.

  • 0

I have a Phonegap app that needs to post data to a remote server. However, when I try to use jQuery’s $.post, it will never go into the callback.

Here is my Javascript:

$(document).ready(function() {
    $('form').submit(function() {
        console.log('about to post');
        $.post('http://mysubdomain.mydomain.com/index.php', function(data) {
            console.log('In callback');
            console.log(data);
        });
    });
});

When I run this and look in the Eclipse LogCat, I see “about to post” but I never see “In callback”. I dumped this into a script tag in my PHP file on my server to make sure it is correct and sure enough, when I refresh the page I see the HTML show up in the Javascript console. I already whitelisted all domains in my config.xml file in res/xml, so I don’t understand why this is not working. If anyone has any insight please let me know. Thanks!

  • 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-06-13T18:05:01+00:00Added an answer on June 13, 2026 at 6:05 pm

    I would guess the reason you are never entering the success callback is that some kind of error is happening. Try the same request with something like:

    $(document).ready(function() {
        $('form').submit(function() {
            console.log('about to post');
            $.ajax({
                url: 'http://mysubdomain.mydomain.com/index.php',
                data: {}, // your data (if any) should go here
                dataType: 'application/json' // or whatever you expect back
                success: function(data) {
                    console.log('In callback');
                    console.log(data);
                },
                error: function(error) {
                    console.log(error);
                }
            });
        });
    });
    

    That should at least show you the error…

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

Sidebar

Related Questions

I am building a PhoneGap/Cordova app and have a simple code that uses http://ricostacruz.com/jquery.transit/
I have a JQuery Mobile app. This app needs to hit a remote web
I have a simple Android App using simple js, jquery mobile and phonegap that
We've put together an app that is mostly working in phonegap. We have an
I have a PhoneGap App using jQuery Mobile. At a certain page, I cannot
I have a Phonegap App, using jQuery and jQuery Mobile. In some page I've
I have built a an app in PhoneGap/Cordova and used the JQuery library for
I have PhoneGap app in Android using jQuery. Sometimes I need to upload some
I have a web app (sencha/phonegap) that includes a feature allowing users to click
I am making an app with jQuery Mobile and PhoneGap. I noticed that when

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.