0

I have a requirement where I have to open a web page from my desktop, enter the username and password and once its logged in, I want to be able to refresh that page after few seconds. I tried this with vbscript, but facing some issue, not able to solve. Just wanted to check if this can be done with javascript as well, if yes, then how?

vbscript -Page refresh after few seconds with entering username and password

Community
  • 1
  • 1
whyAto8
  • 1,660
  • 4
  • 30
  • 56

1 Answers1

0

Why don't you use jQuery to create a timer, and in the timer code, refresh the page. That might be the easiest option.

See here for info on how to setup a timer. You could write something like:

var timer = $.timer(function() {
    location.reload(); // Reload the page
});

timer.set({ time : 5000, autostart : true });

If you only want this to work when the user is logged in, then you could have a server-side guard around this statement. Eg, for something with ASP/VBScript:

<% if (UserIsLoggedIn) then %>
// Javascript code here
<% end if %>
mikeyq6
  • 1,138
  • 13
  • 27