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

  • Home
  • SEARCH
  • 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 3287556
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:30:23+00:00 2026-05-17T20:30:23+00:00

I make this code that, after 9 seconds, it call an ajax function, and

  • 0

I make this code that, after 9 seconds, it call an ajax function, and print the result elaborated from the server to the client.

This is the JS code :

function changeSponsor() {
    $.ajax({
        type: 'POST',
        cache: false,
        url: './auth/ajax.php',
        data: 'id=changespon',
        success: function(msg) {
            $('.menusponsor').hide().fadeIn(1000).html(msg);
        }
    });
}

$(document).ready(function() {
    x=window.setInterval("changeSponsor()", 9000);
});

the result is printed on a div at the top of the page. when the result is printed to the client (after, as said, 9 seconds), and I am at the bottom of the page, the page go automatically at the top. I don’t want this.

You can see an exemple at this link : open this page, go to the bottom (is not so long this page) and after few seconds (9). You will se the page scroll at the top.

How can resolve this problem? Cheers

  • 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-17T20:30:23+00:00Added an answer on May 17, 2026 at 8:30 pm

    It doesn’t look like anything that you mention would move the page up, it must be something else?

    I found that the page moves up normally when you do something to the url, like adding a hash (#)? are you adding a hash or altering the url in any way?

    solution:

    oh the problem is with your html, you need to hide the child of menusponsor and not the container itself.

    try this

    function changeSponsor() {
        $.ajax({
            type: 'POST',
            cache: false,
            url: './auth/ajax.php',
            data: 'id=changespon',
            success: function(msg) {
                $('.menusponsor').find('div').hide().fadeIn(1000).html(msg);
            }
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using this code, to make a request to a given URL: private static
Consider the following code: $(a).attr(disabled, disabled); In IE and FF, this will make anchors
In my code I'd like to make my repositories IQueryable. This way, the criteria
I'm needing to make this layout editor that uses a good bit of jQuery
I'm seeing a crash that happens 10 or 20 seconds after a POST request
I seem to make this mistake every time I set up a new development
How can I make this work? switch(property.PropertyType){ case typeof(Boolean): //doStuff break; case typeof(String): //doOtherStuff
Let's make this very easy. What I want: @array = qw/one two one/; my
Just to make this clear - what is the difference between: String(value) and value
How can I make this java generic cast ? public interface IField { }

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.