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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:16:41+00:00 2026-06-14T00:16:41+00:00

I have a bunch of <a> s on a html page, each associated with

  • 0

I have a bunch of <a>s on a html page, each associated with a form and want to display a ‘loading’ image while the form itself sumbits (which seems to take ages, but maybe this is another matter).

So I did something a bit hackish in the onclick event of those as

frmContent = $ ( this ).nextAll ( "form" ).clone ();
$ ( "body" ).html ( "<div class='preload'><img src='./img/loading.gif' /><br/>Caricamento in corso<\/div>" );
$ ( "body" ).append(frmContent);
frmContent.submit ();

This seems works on both Firefox and IE9. The problem is when compatiblity mode is enabled, this doesn’t work.

I also thought about using something different when the browser is recognized as IE7, like this:

if ( $.browser.version != "7.0" ) {
    frmContent = $ ( this ).nextAll ( "form" ).clone ();
    $ ( "body" ).html ( "<div class='preload'><img src='./img/loading.gif' /><br/>Caricamento in corso<\/div>" );
    $ ( "body" ).append(frmContent);
    frmContent.submit ();
} else {
    $ ( this ).nextAll ( "form" ).submit ();
}

So the preload animation isn’t shown, but this defeats the purpose.

Since I can’t force my users to turn off compatibility mode and since this page must also work in IE7, what’s wrong with that snippet? Is there a better way to do that.

  • 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-14T00:16:42+00:00Added an answer on June 14, 2026 at 12:16 am

    Append form to a body before you submit it.

    frmContent = $ ( this ).nextAll ( "form" ).clone ();
        $ ( "body" ).html ( "<div class='preload'><img src='./img/loading.gif' /><br/>Caricamento in corso<\/div>" );
        frmContent.hide();
        $ ( "body" ).append(frmContent);
        frmContent.submit ();
    

    Like a workaround. I see no reason to replace all body HTML with preload div and clone a form. You can simply hide everything before submit and append preload div:

        $ ( "body" ).children().hide();
        $ ( "body" ).append( $("<div class='preload'><img src='./img/loading.gif' /><br/>Caricamento in corso<\/div>") );
        $ ( this ).nextAll ("form").submit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of HTML pages with a form on each page for
I have a bunch of image tags in my HTML page. I want to
I have one form on a page which has a bunch of sibling h5
So I have a bunch of buttons on a page, interspersed with other HTML,
We have bunch of Domain Entities which should be rendered to an html format,
I have bunch of HTML pages, each contains a line at the top of
Consider a HTML page with a bunch of tags each with their own content.
I currently have a page with a bunch of lists, where each list has
i have a bunch of repeating textboxes and comboboxes on an html page. I
I have a bunch of html files that come with my app and are

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.