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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:26:32+00:00 2026-05-29T05:26:32+00:00

I want to display alert message and then refresh the page. But it take

  • 0

I want to display alert message and then refresh the page.

But it take infinite loop of alert messages.

   if(isValid){
      alert("alert some text");
      document.location.reload(true);
   }
   else {
       .............
   }

How can I do that with out infinite loop

  • 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-29T05:26:33+00:00Added an answer on May 29, 2026 at 5:26 am

    You would have to pass along the state. Possibly refreshing the page by pointing itself with a querystring variable. Then read that variable

    if (getParameterByName("reloaded") != "yes") {
        alert("username or password are incorrect");       
        window.location = 'mypage.html?reloaded=yes';  
    } else {
        // Do something else..
    } 
    

    Note the getParameterByName function is found at another stackoverflow answer: How can I get query string values in JavaScript?. You could alternatively use a library such as jQuery for a better solution.

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

Sidebar

Related Questions

I want to display error message or alert message after checking the condition. here
I want to display a alert message when a user clicks on button. I
I want to display an alert box multiple times with a button click event
I want to display script errors in a popup alert instead of showing them
I want to display a form in a Div, in alert box. How would
I want to fade in text when loading a page, w/ the background-color slowly
I want to concatenate messages in my alert so that it show all error
I want to show confirmation alert message to user on tap of the image.
I want display data from database in Listbox...Here is my code, It is not
i want display 1 record from colums zodys , I'm programint in C# I

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.