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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:44:12+00:00 2026-05-22T14:44:12+00:00

I am giving a call with click, and this will go to server call.

  • 0

I am giving a call with click, and this will go to server call.

$(this).click(function(){
   alert($(this).html()); //this is giving value
   var urlLink = someURL;
   var data = "id=" + "123";
   $.ajax({
        url : urlLink,
    data : data,
    cache: false,
    success : function(resp) {
      alert($(this).html()); //this is giving null
    }
   });
});

Once after success, if i alert the same giving null. could any once please give an idea, what’s going wrong.

  • 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-22T14:44:12+00:00Added an answer on May 22, 2026 at 2:44 pm

    From the jQuery documentation:

    The this reference within all
    callbacks is the object in the context
    option passed to $.ajax in the
    settings; if context is not specified,
    this is a reference to the Ajax
    settings themselves.

    Either set the context option of the ajax object, or save the object in a variable outside the scope of the callback function.

    $(this).click(function(){
       var $obj = $(this);
       alert($obj.html()); //this is giving value
       var urlLink = someURL;
       var data = "id=" + "123";
       $.ajax({
            url : urlLink,
        data : data,
        cache: false,
        success : function(resp) {
          alert($obj.html()); //this will give you the value too
        }
       });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i skip first argument without giving any value in function call,so that
In the method validateType it will call the method intgerValidation why is this giving
In this code when I call the cleanGrid() function my goal was to get
When I call getCount function in the below code, QT 4.7.3 complier giving the
JSLint is giving me this error: Problem at line 11 character 33: Use the
I'm giving a user a link to download a csv file ...just using Click
This line is giving error: Too few arguments. What is the problem? $InsertQuery =
Why is this thing giving the message in the second line (i.e. list convertion)?
I'm giving MVC another shot, and I feel like I'm learning freakin' HTML all
I have a VB.net application and I have a function with this signature: Public

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.