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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T06:51:08+00:00 2026-06-15T06:51:08+00:00

I have this jQuery ajax: // … omitted code … var data = {‘TagName’:’

  • 0

I have this jQuery ajax:

        // ... omitted code ...

        var data = "{'TagName':'" + TagName + "'}";

        var resultSet = 0;

        jQuery.ajax(
        {
            type: "POST",
            url: '<%= ResolveUrl("~/Webservices/TagWebServices.asmx/GetTagByTagName") %>',
            data: data,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (t)
            {
                resultSet = t.d;
            }
        });

        jQuery(this).after("<div style='color:#E3E3E3; margin-bottom:10px;'>" +
        resultSet.desc +
        "</div>" );

        // ... omitted code ...

The problem is that resultSet.desc always returns “undefined” BUT when I use Firebug and add a breaking point in the last line and then click (Continue) resultSet.desc works as expected.

  • 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-15T06:51:10+00:00Added an answer on June 15, 2026 at 6:51 am

    Ajax is asynchronous by default.
    You could try to set ajax request synchronous setting: async:false, but this is a bad way.

    The way to go is to code your logic in the success callback function keeping ref on ‘this’ object.

    var data = "{'TagName':'" + TagName + "'}";
    
            var resultSet = 0,
                that = this;
    
            jQuery.ajax(
            {
                type: "POST",
                url: '<%= ResolveUrl("~/Webservices/TagWebServices.asmx/GetTagByTagName") %>',
                data: data,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (t)
                {
                    resultSet = t.d;
                     jQuery(that).after("<div style='color:#E3E3E3; margin-bottom:10px;'>" +
                        resultSet.desc +
                        "</div>" );
                }
            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code in jquery: $.ajax({ type: POST, url: tosql.php, data: {textnode: textnode},
I have this jQuery code: $.ajax({ type: POST, url: /problems/vote.php, dataType: json, data: dataString,
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have grabbed some XML data using this piece of jQuery: $.ajax({ type: POST,
i have ajax function that looks like this: jQuery.ajax({ type: 'POST', data: { action:
I have an issue I have this jQuery code: $(document).ready(function(){ $(#follow).click(function(){ $.ajax({ type: 'POST',
I have this jquery code: var myarr = [aa,ss,dd]; $.ajax({ url: proces.php, data: arr=+myarr,
I have this Javascript/JQuery code: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script> <script type=text/javascript> name = $(#name).val(); alert(Name:
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
i have this jQuery-AJAX code below and a form: <script type=text/javascript> $(document).ready(function () {

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.