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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:22:40+00:00 2026-05-22T03:22:40+00:00

After doing so: $.ajax({ type: POST, url: $(#form).attr(action), data: value= + value + &sel=

  • 0

After doing so:

        $.ajax({
            type: "POST",
            url: $("#form").attr("action"),
            data: "value=" + value + "&sel=" + sel,
            success: function(data) {
                $("#cont-pag").html(data);
            }
            /*success: function(msg) {
                alert(msg);
            }*/
        });    

I get a big chunk of code (I checked with the alert msg) inside a . I already have a big div cont-pag in my original page, I just want the one from the ajax call to replace the previous one. Am I doing this wrong?

Edit: the structure that’s supposed to show up goes like this:
I have my query over here and stuff and then…

echo'<div id="cont_pag">    
<ul id="content_pag">'; 
    while($row = mysql_fetch_object($res)){ 
                echo'<li>...</li>';
            }
echo'</ul>'; //here is when my msg will stop painting code, but there's more:
if (mysql_num_rows($res)>8)
echo '<div id="page_navigation"></div><div class="siguiente-pag"><p>'.$cajon_siguiente.'</p></div>
 </div>'; ?>

Ok so I answer that last thing myself. I missed my markup as always:

 echo '<div id="page_navigation"></div><div class="siguiente-pag"><p>'.$cajon_siguiente.'</p></div>';
 echo'</div>'; ?>

And now the alert shows it properly but the .html doesn’t replace the original div. May I have a conflicting script somewhere? (it’s a complex project and a lot of people work on it and has a few jquery tweaks here and there). Can I do the div replacement differently?

  • 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-22T03:22:41+00:00Added an answer on May 22, 2026 at 3:22 am

    Try adding:

    dataType: 'html',
    

    To specify what sort of data is being returned. Also consider using Firebug and it’s console.log function to check for errors and what is being returned.

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

Sidebar

Related Questions

I get the following response from the server after doing an ajax request: {error:false,success:true}
I'm trying to submit a form via AJAX and prevent a redirect after the
After doing an AJAX call, am redirecting- using the following code. But, after AJAX
I'm doing user auth via an Ajax post-request in Rails, and I thought that
After doing some work with Ruby, Rails, and RSpec last summer and I learned
After doing a project with WPF and getting very much attached to it's excellent
After doing a subversion merge with a co-worker, my VSeWSS project no longer build
After doing some research on the subject, I've been experimenting a lot with patterns
After doing a long search on stackoverflow i didn't find any one talked about
After doing a light search on the Lazarus site I've come to the conclusion

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.