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

  • Home
  • SEARCH
  • 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 6943297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:08:13+00:00 2026-05-27T13:08:13+00:00

Ajax never returns a value. I have tried setting the async:false option and also

  • 0

Ajax never returns a value. I have tried setting the async:false option and also tried to setup a callback function it still never returns a value. When i browse to the url using firefox i see the expected response but when i make the request via ajax, there is no reponse. Firebug also confirms it.

I have tried lots of code samples i found but they never return a value. I have also tried using a different version jquery and other browsers.

Does anyone know what could be wrong?
Thanks
Below is the code that gets called when a user clicks a button on the form.

function login() {
    var username = $("#uname").val();
    var password = $("#password").val();
    $.ajax({
        type: 'POST',
        url: 'http://localhost/mConnect/login.php',
        data: { username: username, password: password },
        async: false,
        success: function(html) {
            slim(html);
        }
    });
}

function slim(html) {
    // var data = $(xml).find("Status").text();
    alert(html.responseText);
}

Below is the login.php it just prints static xml

<?php  
    $array = array('stat'  => '1.0',
                    'mode'   => 'whatever',
                    'content' => 'All');

    $new ='<?xml version="1.0" encoding="iso-8859-1"?><response>';

    foreach($array as $key => $values) {
        $new .= "<$key>$values</$key>";
    }
    echo $new.'</response>';
?>
  • 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-27T13:08:14+00:00Added an answer on May 27, 2026 at 1:08 pm

    You have a success callback, but no failure callback. Probably something along the way is failing and there are about 100 possibilities. Run it in Firebug (or equivalent) and see what happens to the request. (My money: your local webserver isn’t responding at all.)

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

Sidebar

Related Questions

I'm currently working with MVC 1.0 and have never worked with AJAX before and
I am calling a page that returns data like: <div id=class> <option>Value</option> <option>Value</option> </div>
I have the following ajax success function. How can I act on the result
I've never used AJAX and am, quite frankly, not much versed in JS either.
You've seen this - on an ajax-heavy page, like meebo.com, the browser never stops
.ajax({ type: 'POST', url: '..serverices/ajaxserver.asmx', data: 'lname='+ $('#lastname').val() }); return false; if #lastname has
ajax tutorial on w3school at http://www.w3schools.com/ajax/ajax_database.asp In this function (function GetXmlHttpObject()), it creates a
Ajax needs xmlhttp. Does Asp.net ajax, ajaxcontrol toolkits also needs xmlhttp for their smooth
AJAX is a pain in the ass because it essentially means you'll have to
I have a simple ajax call like this: $.ajax({ url: u, type: POST, dataType:

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.