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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:49:52+00:00 2026-05-17T02:49:52+00:00

var request = new Request({ method: ‘get’, url: ‘onlinestatusoutput.html.php’, onComplete:function(response) { $(‘ajax-content’).get(‘tween’, {property: ‘opacity’,

  • 0
 var request = new Request({
   method: 'get',
   url: 'onlinestatusoutput.html.php',
   onComplete:function(response)
   {
     $('ajax-content').get('tween', {property: 'opacity', duration: 'long'}).start(0).set('html', response).set('html', response).tween('height', [0, 650]);
   }
  }).send();

Before I load the desired content into the div, I have text that says “Loading Content…”.

What I’d like to do is fade out the text that says “Loading Content…”, and then fade in the content loaded in from the AJAX Request.

How exactly would I accomplish this?

I tried using the fade(‘in’) and fade(‘out’) methods, but that didn’t work. I also tried another call to the get() method and set the opacity to 1 via start(1), but that didn’t work either.

  • 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-17T02:49:53+00:00Added an answer on May 17, 2026 at 2:49 am

    you don’t need to get the instance of Fx.tween and apply start, use the element prototype .fade which does it for you.

    only thing you need to do is SET the onComplete (as this cannot be async) to replace content, remove the oncomplete and then fade back in.

    check this jsfiddle for demo:
    http://www.jsfiddle.net/dimitar/NF2jz/291/

    new Request.HTML({
        url: '/echo/html/',
        data: {
            html: "loaded content is now in",
            delay: 3
        },
        method: 'post',
        onRequest: function() {
            document.id("target").set("html", "Loading content...");
        },
        onComplete: function() {
            var response = this.response.text;
            document.id("target").set("tween", {
                onComplete: function() {
                    this.element.set("html", response);
                    this.removeEvents("complete");
                    this.element.fade(1);
                },
                duration: 1000
            }).fade(0);
        }
    }).send();
    

    this is for testing purposes on jsfiddle (you send the data along with the request to simulate the response and specify the amount of seconds to delay the response from the server)

    another way to handle it is chaining on the fx instance:

            onComplete: function() {
                this.element.set("html", response);
                this.removeEvents("complete");
            },
            link: "chain"
        }).fade(0).fade(1);
    

    have fun

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

Sidebar

Related Questions

My flash code: var request=new URLRequest('http://localhost/test.php'); request.method = URLRequestMethod.POST; var data = new URLVariables();
I have this code working in C#: var request = (HttpWebRequest)WebRequest.Create(https://x.com/service); request.Method = GET;
I'm formulating an Ajax request using prototype in the following method: function updateServerStep(stepNumber){ alert(updating
I'm looking for an AJAX function to dynamically request an HTML page. I already
var request = new WebClient(); request.DownloadFile(http://2nditeration.ca/Images/facebook.png, C:\tmp\filename.png); The first parameter is saying there are
Hola check this code. var watch = new Stopwatch(); watch.Start(); var request = HttpWebRequest.Create(new
def sss(request): handle=open('b.txt','r+') handle.write(I AM NEW FILE) var=handle.read(); return HttpResponse(var) urlpatterns = patterns('', ('^$',sss),
Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
I have the following piece of code: // setup the AJAX request var pageRequest
I'm trying to request a url but it fails and when I var dump

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.