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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:19:20+00:00 2026-06-17T16:19:20+00:00

I made a simple example showing the problem: the form below submits to another

  • 0

I made a simple example showing the problem: the form below submits to another page using jQuery .post().

Form

$('form').submit(function(){

    $.post(
        $(this).attr('action'),
        $(this).serialize(),
        function(data) {
            var ret = data;
            var final_data = $(ret).find('#holder-1').html();
            alert(final_data);
        }
    )
    return false;

})

Action

<div id="holder-1">
    <h1>Content 1</h1>
</div>

<div id="holder-2">
    <h1>Content 2</h1>
</div>

<div id="holder-3">
    <h1>Content 3</h1>
</div>

The log shows that the content of data looks fine. But once i try to find #holder-1 with .find(), it returns undefined.

This is almost the same as the last example in the jQuery api page: http://api.jquery.com/jQuery.post/

Here is the full (not) working example hosted in my website, with some console.log() along the code:

Form: http://www.peixelaranja.com.br/tmp/post.php

I tried nearly anything: passing the dataType as 4th parameter, using $.ajax() instead of .post(), using .filter() instead of .find(), different versions of jQuery… Nothing seems to work.

All the files are UTF-8.

Any ideas?

  • 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-17T16:19:21+00:00Added an answer on June 17, 2026 at 4:19 pm

    I know you mentioned that you used filter instead of find, however, that should work. jQuery is stripping out the html, head,body tags, etc. Once this is done, #holder-1 is now at the top level of the hierarchy.

    This fiddle demonstrates that filter does work:

    http://jsfiddle.net/68jEt/

    var html = '<!doctype html><html dir="ltr" lang="pt-BR"><head>  <meta charset="UTF-8">  <title>Return Test</title></head><body> <div id="holder-1">     <h1>Content 1</h1>  </div>  <div id="holder-2">     <h1>Content 2</h1>  </div>  <div id="holder-3">     <h1>Content 3</h1>  </div></body></html>';
    
    alert($(html).filter("#holder-1").html());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've made a simple NPRuntime plugin calls Javascript function when it loaded. Based example
I have made simple example of using canvas and then I saw that my
I have made a very simple page using google maps API with several fields
In the Symfony2 documentation it gives the simple example of: $client->request('POST', '/submit', array('name' =>
I'm working on a bigger project atm, but I made this simple example to
hi i've got question i've made simple form with attachment input and i want
OK, I have made simple rectangular using OpenGL, and it looks pretty simple glNormal3f(0.0f,
On Windows, testing different OSes is made simple using VMs. Is there a simple
I made a simple clock signal using goroutines: func clockloop(ch chan byte) { count
I'm looking for a simple example of JQuery tabs in which I am planning

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.