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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:14:57+00:00 2026-05-25T19:14:57+00:00

I have this script on a page of mine and the setTimeout function never

  • 0

I have this script on a page of mine and the setTimeout function never fires. It’s just an alert right now but i’m just testing it out. I’m doing a meta refresh on the page just after it if that’s any clue, but i’ve also given that a 10 sec delay so the page isn’t refreshed before it’s supposed to trigger.

Also, the related question: If I run a javascript with a delay of, say, 10 seconds (with setTimeout) and in that javascript I try to modify a design element that’s not on the page when the setTimeout is declared but will be by the time the script is fired. Will it work?

<script language=javascript>

var xmlhttp_get_memento;    
function loop_alerte(){
    setTimeout( function() {
        alert("timeout");
    }, 5000);
    xmlhttp_get_memento = new XMLHttpRequest();
    if (xmlhttp_get_memento==null)
    {
        alert ("Browser does not support HTTP Request (1)");
        return;
    }   
    var url="crm/ajax/get_mementos.php";
    url=url+"?sid="+Math.random();
    xmlhttp_get_memento.onreadystatechange=function() {
        if (xmlhttp_get_memento.readyState == 4) {  
            alert(xmlhttp_get_memento.responseText);                                        
            schimbare_tip_cursor("default");
        }
        else{
            schimbare_tip_cursor("progress");
        }
    };

xmlhttp_get_memento.open("GET",url,true);
xmlhttp_get_memento.send(null);
}

loop_alerte();
</script>';
  • 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-25T19:14:57+00:00Added an answer on May 25, 2026 at 7:14 pm

    Your setTimeout looks good, so there’s probably something else that’s wrong. Have you tried using a javascript debugger to see if you get any errors?

    As for your second question, yes, that shouldn’t be any problem, as the anonymous function inside the setTimout won’t be evaluated until it runs. Live sample here: http://jsbin.com/afonup/2/edit Both with and without jQuery.

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

Sidebar

Related Questions

I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
I have this script that opens a new page inside a span: $(document).ready( function()
I have this script on my html page: <script language='javascript'>parent.resizeTo(550,510);</script> I'd like to add
i have this script $content = string if(!isset($_GET['page'])){ $page = 1; } else{ $page
I have this script and when i try to run it, it just says
I have this script to load some images after page loading is complete I
I load everything on my page. At the end, I have this script. <script
i have this script on the page where i want to load the file
I have found this script that expand image when mouse is over, but when

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.