Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Auto Refresh

Recommended Posts

Does anyone know if there is a javacript command to bring the browser to the same part of a long page after a refresh called by a pop up (populating a db).I have tried various methods including refresh() and reload() as well as redirecting back to the original page in the opener window.Does this functionality exist ?? please help...

Share this post


Link to post
Share on other sites

What you are looking for is possible, but it is not JavaScript.. Rather, it is part of the HTML standard. Just use simple anchor tags (<a>) but instead of using the href attribute, you use the name attribute. That creates an anchor to a page spot (like half way down a long page).. then, when you want to link to that page AT the anchored spot you would use: index.html#named_anchor

 

The pound sign '#' is a directive that says "look for an anchor in this page with the same name.." or something of the sort..

 

An example would be:

 

Filename = mypage.html:

<html><head></head><body><a name="pageTop"></a><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><a href="mypage.html#pageTop">Go To Top of Page</a></body></html>

I hope you could follow that.. it is pretty simple really.. And you don't have to direct to the top of a page, it could be anywhere, wherever you put the <a name="pageTop"></a> tag(s) you can link to..

 

I hope that helps!

Share this post


Link to post
Share on other sites

<meta http-equiv="refresh" content="page.htm;5">
Just to correct you on your on your code there:

 

<meta http-equiv="refresh" content="5;url=page.htm">

 

A guide to the key points:

 

refresh - tells the browser to refresh

5 - after 5 seconds

page.htm - to the url page.htm

 

Notice from snlildude87:
Use
 tags for HTML codes 
Edited by snlildude87 (see edit history)

Share this post


Link to post
Share on other sites

I have similar problems in my Java application with Swing. The panels refresh only when I maximize/minimize the frame. Can someone tell me how to rectify this?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.