|
| |
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
Refresh the Page Once OnLoad - 8/23/2002 20:40:24
Hi All, How can I refresh a page once when it loads, using JavaScript, VBScript or HTML. Something like onload=window.refresh. I know how to make it refresh every xSeconds. But I want it to refresh only once onLoad. I tried the following to refresh the window once, Is it right? <Body onLoad=window.refresh> I know how to refresh it after an amount of time, like this <META HTTP-EQUIV=" refresh" content=" 300;URL= http://www.myapage.com/folder/page.htm" > This will make it refresh every 5 minutes. I just want it to refresh once on load. Thanks
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 8/23/2002 21:56:24
Try this: Place this at the top of your page: <script language=" JavaScript" ><!-- function MyReload() { window.location.reload(); } //--></script> Then change your <Body> to say; <Body onLoad=" MyReload()" > That should do it.
_____________________________
|
|
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 6:25:21
Thank you verymuch lune. Hisham
|
|
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 6:30:50
Hi Lune, Do I have to specify any location? I tested the page, it is stuck in a loop. Thanks Hisham
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 10:24:30
Did you remove your meta tags? Also, remove any programming on that page you experimented with prior. The <onload> only occurs once. It' s my guess that it' s your meta tags or something else that is still on the page.
_____________________________
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 11:46:24
Interesting question. Crossed my mind too.
_____________________________
|
|
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 12:44:52
Hi, 1-It is still stuck in a loop, I pasted the code in new page which has no programming at all. To answer your question There is a person who asked me how to do it for one reason. She does not know why the horizontal scroll bar is coming to the page and when she presses refresh, the horizontal scroll bar goes and the page looks fine. She is not using any frames. She designed the page using Frontpage. This is why she wants a solution for either getting rid of the Horizontal scroll bar or refresh the page autoamtically once onLoad. Regards Hisham
< Message edited by hhammash -- 8/23/2002 12:46:10 PM >
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 12:58:34
Hisham, It sounds like your friend has a bigger problem than trying to refresh the page. If a horizontal navigation bar appears than disappears on a refresh, wouldn' t it be smarter to attack this problem??? Your right, the method I gave you does not actually work. I tried it. The page reloads, then goes to the <body>, then reloads, then goes to the <Body> and so on and so on. It' s true that the <Body> is only executed once on a page load, but if you keep reloading the page, <Body> is going to get executed each time. I don' t think there is an answer to this loop problem. If I were you, I would concentrate on how to stop the horizontal bar from displaying. When it comes to FP automatic navigation bars - HOMEY DON' T PLAY THAT. Maybe you should repost your question. Sorry...
_____________________________
|
|
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 16:01:47
Hi bobby, I know it seems odd to me too, this is why I got interested. I will try and get the page address. Thanks Hisham
|
|
|
|
carm
Posts: 11 Joined: 8/16/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/24/2002 23:52:08
I had this problem, but only when being viewed on netscape. Have her check the sizes on all tables used on the page and make sure that everything adds up. My problem came in that although the table sizes added up, i used a table inside a table specifying a % and it through everything off on netscape. Mine too would work fine after I reloaded the page. It might be the cause, it might not be.. good luck.
|
|
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/25/2002 9:02:25
Hi all, I' ve got the link. I tested it. It is fine. http://www.swreporter.com Hisham
|
|
|
|
hhammash
Posts: 1064 Joined: 8/19/2002 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/26/2002 4:32:41
Thank you bobby, I will convey the message Hisham
|
|
|
|
ACEDISH
Posts: 176 Joined: 9/30/2002 From: Manassas, Virginia Status: offline
|
RE: Refresh the Page Once OnLoad - 10/30/2002 17:09:49
wow, someone else ran into this problem!! I have it happen to me all the time but not on all my pages and refresh will fix it. I have had it happen using frames, without frames with FP2000 and FP2002. I have a situation now go to www.dishtrack.com and notice on the right side there is a space hit refresh and it goes away...
|
|
|
|
Eli
Posts: 2658 From: ... er ... Status: offline
|
RE: Refresh the Page Once OnLoad - 10/30/2002 19:04:58
i couldn' t see any difference with either urls. This is a very interesting thread - what am I missing?! ie 5.5 800x600
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 10/30/2002 20:22:04
I went to this site too and looked on the right. What are we looking for???
_____________________________
|
|
|
|
ACEDISH
Posts: 176 Joined: 9/30/2002 From: Manassas, Virginia Status: offline
|
RE: Refresh the Page Once OnLoad - 11/1/2002 22:42:48
Its a very small space at the right of the blue header and footer bar on the page. When you hit refresh it goes to full page, It is more noticable on other pages. www.dishtrack.com If anyone is interested, Costa
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 11/1/2002 23:47:37
Acedish, I tried it again. The page looks the same to me before and after refresh. Sorry - I can' t see it.
_____________________________
|
|
|
|
dvfortuna
Posts: 1 Joined: 8/13/2003 Status: offline
|
RE: Refresh the Page Once OnLoad - 8/13/2003 22:42:07
Good day all, i am new to this forum. i hope you could help me. i have the same problem. but with slight difference. i have a page with german characters on it. there are times that the characters wont display properly and there are times it will display correctly. most of the time it wont display correctly is the the first visit but after you refresh the characters will display properly. i have tried it on 5 computers and 2 out of 5 computers will act this way. as of the moment i dont know why this is happening. but as of the mean time i need a code which will refresh the page once. this is just a temporary solution until i figure it why this happen. FYI: the page already have <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> i cant give you link to the page since it not up yet. but as soon its already up, ill post the link. thanks,
|
|
|
|
Long Island Lune
Posts: 2340 Joined: 6/8/2002 From: New York Status: offline
|
RE: Refresh the Page Once OnLoad - 8/15/2003 18:53:51
Have you tried placing this line in your body label? <Body onLoad=window.refresh> This will refresh the page once each time someone visits.
_____________________________
|
|
|
|
sparticus_79a
Posts: 1 Joined: 2/9/2005 Status: offline
|
RE: Refresh the Page Once OnLoad - 2/9/2005 16:06:38
On the current webpage write a cookie, then insert <body onload="history.go(-1)"> command forcing the page to go back, now on the previous page write a code like, <% if cookie<>"1" then response.cookies("1").Expires = Date-1000 response.redirect("your_page.asp") end if %> this will refrest the page until the cookie is deleted
|
|
|
|
bigron
Posts: 1 Joined: 12/13/2005 Status: offline
|
RE: Refresh the Page Once OnLoad - 12/13/2005 4:31:06
Hi All, Try this; <script type="text/javascript"> if (window.name!="xxxxxx") { window.name="xxxxxx"; location.reload(); confirm("Done it, page reloaded."); } Stick code between the <headers></headers> of your page. Don't forget to remove the confirm line of code; it's only there to let you know that it has worked.
|
|
|
|
JasonBoyd
Posts: 2 Joined: 4/21/2006 Status: offline
|
RE: Refresh the Page Once OnLoad - 4/21/2006 13:21:08
I have a similar problem I wonder if anyone handling this could solve. I have a site similar to that of windows live or personalized google which uses AJAX to save changes that occur on a page, such as dragging the location of RSS feeds etc. Everything works great but if these settings change e.g. you move the item in position 1,1 to position 1,3 then you click a link on the page and use the back button to go back to that page, those changes are not kept. But if the page reloads, allowing the page to be built from the previously saved settings, then everything is fine. So what my question is is there a way to detect that someone has backed up to this page, thus forcing the user to reload it. pragma no-cache doesn't seem to work and all I can think of is to force a postback on load so that the page isn't displayed but this could cause some unwanted overhead. Any ideas?
|
|
|
|
JasonBoyd
Posts: 2 Joined: 4/21/2006 Status: offline
|
RE: Refresh the Page Once OnLoad - 4/21/2006 14:37:15
ok I found that this will work in IE: Response.Cache.SetCacheability(HttpCacheability.ServerAndNoCache); Response.Cache.SetAllowResponseInBrowserHistory(false); but it doesnt work in NS, Firefox, any ideas what this does?
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|