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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:37:27+00:00 2026-06-01T19:37:27+00:00

With the following code: $(‘#langHref’).html(Translating…).css(color,#FF9933); jQuery.ajax({ type: post , url: someUrl , data: {

  • 0

With the following code:

            $('#langHref').html("Translating...").css("color","#FF9933");

            jQuery.ajax({
                type: "post"
                 , url: someUrl
                 , data: { "text": $('body').html() }
                 , async: false 
                 , success: function (data, status) {  
                     $('body').html(data);                      
                 },
                error: function () {
                    alert('We are sorry, there was an error in the translation service.');
                    //console.log("ERROR", arguments);
                }
            });

            $('#langHref').html("Select Language").css("color","");
        }

I have a <a> tag with the id of “langHref”, the idea here is that just before the ajax is called the link text is set to “Translating…” and its color changed to orange. After ajax completes the link text changes back to the standard “Select Language”.

This works well in FF but fails in IE and Chrome. I’ve tried all the beforeSend jQuery options and ajaxSend events to try to set it before the ajax goes out but to no avail.

If I turn off async: false then obviously it’s changeing the text back to “Select a language” immediately and you don’t see it work. I also tried async: true and put the “Translating….” call in beforeSend, which doesn’t work in any browser I tried.

Thoughts?

  • 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-01T19:37:29+00:00Added an answer on June 1, 2026 at 7:37 pm

    I think you want to add beforeSend to your ajax request and do this there like so:

    beforeSend: function ( xhr ) {
        $('#langHref').html("Translating...").css("color","#FF9933");
     }
    

    and a complete method too:

    complete : function(jqXHR, textStatus) {
                $('#langHref').html("Select Language").css("color","");
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code is intended to do a purely ajax POST request, instead it
Following code is saved as html file: <?php $IP = 4; ?> <textarea name=comments>$IP</textarea>
Following code are HTML markup and JS part of my signup page. I don't
following code work fine but 1 error $(document).ready( function() { $(#myCheckboxes input[type='checkbox']).change(function() { var
following code waits till dom ready jQuery(document).ready(function(){ what do i have to write to
Following code iterates through many data-rows, calcs some score per row and then sorts
following code doesn't work with input: 2 7 add Elly 0888424242 add Elly 0883666666
Following code is from a sample of playframework-2.0: /** * Display the dashboard. */
Following code is to save image took from camera into photo album. if ([mediaType
The following code works fine: person = {:a=>:A, :b=>:B, :c=>:C} berson = {:a=>:A1, :b=>:B1,

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.