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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:15:20+00:00 2026-05-27T09:15:20+00:00

$.post( url, JSON_POST, function( data ) { var content = $( data ); var

  • 0
 $.post( url, JSON_POST,
    function( data ) {
      var content = $( data );
          var content = $( data ).find( '#json' );
        console.log(data);
           console.log(content);
      }
    );

The result of the first console.log is

<div id="json">{"status":1,"message":"Reply submitted successfully."}</div> 
<div id="test">sdfsafdsfds</div>

But for some reason the second log returns an empty array. I am trying to query the html inside the data variable but the result is always the null set.

I would really appreciate helping me with this. I went through the $.post manual but nothing is mentioned about the this problem.

P.S I am using JQUERY 1.7

  • 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-27T09:15:21+00:00Added an answer on May 27, 2026 at 9:15 am

    find looks for descendants of the selected elements. In your case, both elements have no descendants, not to mention any with ID json.

    Instead, you are looking for a specific element of the selected ones. In this case, you should filter [docs] the current elements:

    var content = $(data).filter('#json');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

function onTestComplete(content) { var url = '<%= Url.Action(JsonTest,Organization) %>'; $.post(url, null, function(data) { alert(data[name]);
$('#post_form').submit(function() { $(#ajax_bar_loader).show(); $.ajax({ url: 'add.html', data: $('#post_form').serialize(), dataType: 'json', type: 'post', success: function(
$.ajax({ type: POST, url: WebService.asmx/AddVisitor, data: {'fname':'dave', 'lname':'ward'}, contentType: application/json; charset=utf-8, dataType: json });
I am calling a service that return JSON data. Script: $.ajax({ type: "POST", url:
I have the following javascript: $.ajax({ type: "POST", dataType: "json", url: "/Home/Submit", data: {
I have the following code: <script type=text/javascript> $(document).ready(function() { $(#Save).click(function() { $.post(url, { data:
I am using $.ajax function to send json data to serverside function. var jsonObjects
JQUERY: $(document).ready(function(){ $('form').submit(function(){ var content = $(this).serialize(); //alert(content); $.ajax({ type: 'POST', dataType: 'json', url:
I just want a function that can take 2 parameters: the URL to POST
I need to POST data to a url in the middle of a script.

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.