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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:22:56+00:00 2026-06-13T23:22:56+00:00

I have this Javascript below And want to do it in working in FireFox

  • 0

I have this Javascript below

And want to do it in working in FireFox
I wanted to keep 5 seconds delay after each submit

<html>
 <head>
 <script type="text/javascript">
function sleep(ms)
    {
        var dt = new Date();
        dt.setTime(dt.getTime() + ms);
        while (new Date().getTime() < dt.getTime());
    }

function test() {
var windowCounter = 1; 
var myStringArray = [ "user1", "user2" , "user3" , "user4" ]
var len = myStringArray.length;
for (var i=0; i<3; ++i) {
document.inform.cid = myStringArray[i];
document.inform.pwd = "xxxxxxxx";
   document.inform.target = windowCounter++; // a different target each time
    document.inform.submit();
}
}
</script>
 </head>
 <body >
  <form name="inform"   target="newWin" action="https://www.google.co.in/">
<input type="text" name="cid"  />
<input type="hidden" name="pwd"  />
 <input type="hidden" name="throttle" value="999" />
    <input type="submit" value="go" onclick="test()">
  </form>
 </body>
</html>

I have tried keeping sleep manually after each submit and tried using setTimeOut , but nothing is working .

could anybody please help me

Edited Part

<html>
<head>
<script type="text/javascript">
  var interval = window.setInterval(iterate, 5000);
var myStringArray = ["user1", "user2", "user3", "user4"];

  function iterate() {
 iterate.arr = iterate.arr || myStringArray.slice(0);

    //if it still has elements left
    if(iterate.arr.length > 0) {
        document.inform.cid = iterate.arr.pop(); //remove the top one
alert(document.inform.cid);
        document.inform.pw = "xxxx";
        document.inform.target = iterate.arr.length; // a different target each time - length of the arr
        document.inform.submit();
    } else {
        window.clearInterval(interval); //no more left cancel it
    }
};

</script>
</head>
<body>
 <form name="inform" method="get"  target="newWin" action="https://www.google.co.in/">
  <input type="text" name="cid" />
<input type="password" name="pw" />
<input type="hidden" name="throttle" value="999" />
    <input type="submit" value="go" onclick="iterate()"/>
  </form>
</body>
</html>
  • 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-13T23:22:57+00:00Added an answer on June 13, 2026 at 11:22 pm

    Could you use something like (not tested though):

        var interval = window.setInterval(iterate, 5000);
        var myStringArray = ["user1", "user2", "user3", "user4"];
    
    function iterate() {
        iterate.arr = iterate.arr || myStringArray.slice(0); //set a private array to cache
    
        //if it still has elements left
        if(iterate.arr.length > 0) {
        //thought there was more than one formon the page - but if only one then we can reference by its name - cid
    
            ///:document.inform.cid = iterate.arr.pop(); //remove the top one
        iterate.arr.pop();
            document.inform.pwd = "xxxxxxxx";
            document.inform.target = iterate.arr.length; // a different target each time - length of the arr
            document.inform.submit();
        } else {
            window.clearInterval(interval); //no more left cancel it
        }
    
    
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code. The code below is working in Firefox, but it is
i have javascript as below html=<th>+<?php echo __(); ?>+</th>; I want to add another
I have this javascript code below that uses jquery, it is suppoed to be
i have this javascript code to which i want to add the jquery fade-in
Continuous JavaScript Scroller I have below script which is working on next and previous
I have this HTML code, which is invoking my javascript code. The code is
I am working in JavaScript. I have date in below format: Tue Sep 18
Below is the Html button and javascript function I have which closes a modal
I have this Javascript/JQuery code: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script> <script type=text/javascript> name = $(#name).val(); alert(Name:
I have this Javascript function that sends username and password to php file through

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.