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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:43:12+00:00 2026-06-17T06:43:12+00:00

$.post( $(#formReg).attr(action), $(#formReg).serialize(), function(data, textStatus, jqXHR) { $(#info).html(data); alert (data); // to check –

  • 0
$.post(
    $("#formReg").attr("action"), $("#formReg").serialize(),
    function(data, textStatus, jqXHR) {
            $("#info").html(data);
        alert (data); // to check - ok - `folder` is displaying
        if ($("#info").html() == "folder"){
        $("#imgOk").fadeIn();  //doesn't work
        }
});

Seems like #info has another content and not folder, although is checked by alert, and folder is visible on screen as the content.

  • 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-17T06:43:14+00:00Added an answer on June 17, 2026 at 6:43 am

    Sometimes when doing ajax requests, you’ll have code on the server that inserts whitespace in the returned results. It’s not always easy to see where the whitespace is added, but it could be a space before or after the code, like having a single space before <?php in PHP etc.

    The best thing would be to simply remove the space on the serverside, but javascript also has a trim method that will trim following and trailing whitespace from a string:

    if ($("#info").html().trim() == "folder"){...}
    

    That function is not supported in older browsers, so if that’s an issue you can use a regex, or since you’re already using jQuery you can use a similar cross browser function, and it actually uses the same native trim() method in newer browsers, and regex in older browsers, so you don’t have to worry about it:

    $.post($("#formReg").attr("action"), $("#formReg").serialize(), function(data) {
        $("#info").html(data);
        if ($.trim(data) == 'folder') $("#imgOk").fadeIn();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<form id=formReg action=reg.php method=post> . . . <button id=sub>Register</button> </form> This works, but I
I'm trying to validate joinUs form <form id=frmReg method=post onsubmit=return valRegs() action=memb_area/register.php> //js: function
$.post('service.php?getPhotos', function(data){ var photoIds = []; $.each(data, function(){ photoIds.push(this.id); }); console.log(_photoId); //7962669392 console.log(photoIds); //[7980686507,
$.post(include/email_validate.inc.php, { email: $('#email').val() }, function(response){ if(response==email_exits) { alert(E-mail Address Already Registered); return false;
first post here as I'm stuck with my wonderful C++ function. The error I'm
This post shows how to axiomatise a length function for Z3's built-in lists. However,
post methot: function PostChartValues(meter_id, range_type_id, start_date, end_date) { var values = $(#type_selection).val(); //values =
$.post(, {message: msg}, function() {
POST DATA => Accept:application/json, text/javascript, */*; q=0.01 Accept-Charset:ISO-8859-9,utf-8;q=0.7,*;q=0.3 Accept-Encoding:gzip,deflate,sdch Accept-Language:tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4 Connection:keep-alive Content-Length:0 Cookie:pfu=32904422; pfp=PO7PkdBDUwKoMG4FqkriwDLF7jrwcHBEoVqnX2i3;
Post data isn't sent as a query string, so would there be any advantage

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.