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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:53:05+00:00 2026-05-12T08:53:05+00:00

I have a JQuery/Ajax update. It correctly updates in all major browsers, however, dealing

  • 0

I have a JQuery/Ajax update. It correctly updates in all major browsers, however, dealing with error responses does not work in any version of IE.

Heres the ajax submit code:

    $('.ajax_multi_submit').click(function (event) {
        // if javascript is enabled, stop default post
        event.preventDefault();

        // get the id assigned to this form. This id will
        // be added to every id to used in processing
        var element = $(this);
        var Id = element.attr("id");
        var formUrl = $('#ajax_multi_form' + Id).attr('action');

        $.ajax({
            url: formUrl,
            type: "POST",
            dataType: "html",
            data: $('#ajax_multi_form' + Id).serialize(),
            beforeSend: function () {
                showAjaxMultiBusy(Id);
            },
            complete: function () {},
            success: function (html) {
                processAjaxMultiForm(html, Id);
            }
        });
    });

Again, I don’t think the problem is here, as all browsers post updates correctly. However, when processing the result with this code:

    function processAjaxMultiForm(html, Id) {
        $('#ajax_errors' + Id).hide('slow');
        window.setTimeout(function () {
            $('#ajax_busy' + Id).hide('slow');
            if (parseFloat(html)) {
                $('#ajax_message' + Id).html('Record Saved.').show('normal');
                $('#ajax_message' + Id).hide('slow');
            } else {
                $('#ajax_errors' + Id).html(html).show('slow');
            }
        }, 1500);
    }

When an error string is returned instead of an integer ( parseFloat(html) = “some string…” ), FF and Safari correctly display the error in the “else” condition.

IE will always display the “if” condition, regardless of return value (1=success, string=error).

I assume some genius out there will see the problem immediately?

EDIT ——-
Here’s a bit more info. I added a console log to the script to output the html variable. I am getting a proper string on errors, and a “1” on success. I’ve updated the code per a suggestion below to:

function processAjaxMultiForm(html, Id) {
    $('#ajax_errors' + Id).hide('slow');
    window.setTimeout(function () {
        $('#ajax_busy' + Id).hide('slow');
        console.log("html is: " + html);
        if (isNaN(html)) {
            $('#ajax_errors' + Id).html(html).show('slow');
        } else {
            $('#ajax_message' + Id).html('Record Saved.').show('normal');
            $('#ajax_message' + Id).hide('slow');
        }
    }, 1500);
}

As before, works as expected in FF Safari, but IE evaluates both string (error) and integer (success) as a “success”

  • 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-12T08:53:05+00:00Added an answer on May 12, 2026 at 8:53 am

    isNan should work.

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

Sidebar

Related Questions

I have an Asp.net MVC application which uses html5 and jquery on the client
I have a change password page that needs to hash any passwords entered on
I am currently developing a web-frontend for a web service. I am using jQuery
I am writing a small module which will have several different aspects to it,
I've got a page with a bunch of items on it. Each item has
So I've been banging my head against my desk for a few hours on
I am looking for some inputs and advise, I think i know what i
I'm trying to get the class of the parent element of the currently focussed
I'm currently building a web-app that has one section where the user sees a
I'm making some GET requests to an App Engine app, testing in Chrome. Whilst

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.