javascript

I need to open a page then reload it after a certain amount of time  #angularjs #reactjs

  • You cannot open a window and launch some code in that one.
  • The first line in your script does something first.
  • Stack Overflow works best with JavaScript enabled
  • You can’t run your own scripts in the google page.
  • javascript html window settimeout reload

UPDATE: Thank you to everyone who answered. I learned I can’t do exactly what I was trying to do. Fortunately, I found some auto refresh extensions for Chrome that do what I wanted.

@ng_real_ninja: I need to open a page then reload it after a certain amount of time #angularjs #reactjs

UPDATE: Thank you to everyone who answered. I learned I can’t do exactly what I was trying to do. Fortunately, I found some auto refresh extensions for Chrome that do what I wanted.

Simple question. I don’t code very much at all though. I’m trying to direct an html doc to immediately open a specific web page, then reload that same page in the same window after a specified amount of time. The following code works, but opens a new window, which is NOT what I want:

Then I tried using the following:

But this only opens the page. It does not reload it. What am I doing wrong? How do I do this right?

This will only work if your code is at the arriving page. You cannot open a window and launch some code in that one.

In both cases, the first line in your script does something first.

On the first case, it opens a new window then reload the page after ten seconds.

On the second case, it immediately goes to google.

The second line should be enough to work.

Althought, I would advise you to do:

what you did is considered really bad practice.

Have you tried this?

I don’t know if it helps, but maybe it’s not a matter of reloading the page itself, but to run a function that updates some data in your view.

javascript

You might also like More from author

Comments are closed, but trackbacks and pingbacks are open.