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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:09:42+00:00 2026-06-07T03:09:42+00:00

I have used the jquery ajax for getting the values from the server.when the

  • 0

I have used the jquery ajax for getting the values from the server.when the method goes into the ajax success or error, i need to return the value.How to do that.Please guide me.

$.ajax({
    cache: false,
    async: true,
    type: "GET",
    timeout:6000,
    dataType: "json",
    url:url +"log",
    data: { ContactEmail : $("#username").val()},
    contentType: "application/json;charset=utf-8",
    success: function (result) 
    {
        //Here I need to return the result and should get in another method
    },
    Error: function (e)
    {
        //Here I need to return the result and should get in another method
    }
});

update

for example
when i called the checkNetConnection() ,it return the value.i need like this

function checkNetConnection() 
{
        var netresult=0;
        var networkState = navigator.network.connection.type;
        var states = {};
        states[Connection.UNKNOWN]  = 'Unknown connection';
        states[Connection.ETHERNET] = 'Ethernet connection';
        states[Connection.WIFI]     = 'WiFi connection';
        states[Connection.CELL_2G]  = 'Cell 2G connection';
        states[Connection.CELL_3G]  = 'Cell 3G connection';
        states[Connection.CELL_4G]  = 'Cell 4G connection';
        states[Connection.NONE]     = 'No network connection';
        if(states[networkState]=='Ethernet connection'||states[networkState]=='WiFi connection' || states[networkState]=='Cell 2G connection' || states[networkState]=='Cell 3G connection' || states[networkState]=='Cell 4G connection')
        {
            netresult=1;
        }
        else
        {
            netresult=0;
        }
        return netresult;
}
  • 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-07T03:09:43+00:00Added an answer on June 7, 2026 at 3:09 am

    Your results are stored in variables result and e:

    ...
    success: function (result) 
        {
            // result contains the results
            foo( results );
        },
        Error: function (e)
        {
            // e contains the error
            bar( e );
        }
    ...
    
    // Function to do something with the returned results
    function foo( someData ) {
      // do stuff
    }
    
    // Function to do something with the error
    function bar( someErrorData ) {
      // do stuff
    }
    

    A quick way of seeing the data is to display it using alert: alert( results ) or alert( e ) instead of the function calls.

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

Sidebar

Related Questions

I have used jquery tabs for loading data with ajax, but I need to
jQuery return links are not working. I have Used jQuery and the basic Ajax
I have used some jquery components in my web site, Suddenly i'm getting an
I have used autocomplete in jQuery from this link . In the normal browser
For starters, I'm new to ASP.NET Ajax stuff, and only getting back into JQuery
I have been using jquery ajax method to get the json data. I have
i am calling struts2 action from jquery ajax on success it returns string and
I have used JQuery for a small animation work: a table #photos contains 9
I have used JQuery within my asp.net page. JQuery is working fine. I could
I have used Jquery UI DatePicker for the option in my form to select

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.