PDA

View Full Version : Help neede please


activewebs
01-02-2005, 11:44 AM
Hi Guys
This may sound strange but --- I'm looking for a way to make a page relode it's self upon loading

Basicaly just as if the person viewing the page hit the refresh button imidiatly the page loaded, it only needs to happen once but also each time the page is visited

Hope this makes sense ,, bit of java script or somthing ???

Tnx

Richard

JWJ
01-02-2005, 12:08 PM
LOL ... I did this by accident a few weeks ago, however, I'll leave someone who knows what they're doing to tell you the proper way. My way had no way of breaking out of the loop. :lol:

Arne
01-02-2005, 12:17 PM
I hope I don't sound rude, but don't every browser have a "Reload" button? :wink: But yes, that can be done with Javascript, at least it would work in one known browser. You may try this:
<FORM>
<INPUT TYPE="button" VALUE="Reload Page" onClick="history.go(0)">
</FORM>

About the "reloading" the page each time the page is visited (by the same visitor I asume?), I'll guess that can be done with a "no cache" meta tag in the header section. Try if you have any use for the info on this page: http://www.htmlgoodies.com/beyond/nocache.html or search more with "nocache+button" as keyword.

motorwatchercounter
01-02-2005, 12:30 PM
That is a strange one!

John (JWJ) did do this the other day but usining a refresh command in the head tags but it just reloaded constantly. I am not sure if it can be done without creating a loop (where it follows the command and therefore keeps reloading).

Not knowing exactly what you need to do makes it difficult to try and give you alternatives. I can possibly help if you need to update dynamic content. The other option is to use two pages. The first is the page that loads and this then jumps to the second page. These will obviously be different but could be as close as index.html and index.php any load data captured on the first and then sent as a variable to the second.

It looks as thought you are working on something that needs a refresh to get it going. The problem is that a command or script saying refresh will be activated on each refresh creating the loop.

A little more explanation may give you more options.

At least it will bump up the statcounter visits.

motorwatchercounter
01-02-2005, 12:39 PM
Hi Arne,

That would work but I presumed that the refresh had to be clandestine and not triggered.

Just a simple button or link with a self goto would do it without the form and would give a choice of clickables. I thought it had to be hidden and automated ???????

activewebs
01-02-2005, 12:56 PM
Hi Guys
Yes you are right motorwatcher , it needs to be hidden and one time only action on each page load

I get the picture with the refresh comand , it would ,of course, refresh its self endlesly , :oops: I didnt think of that,

Heres why we need to do this -
We are building a site and we want the pages to center in browser , OK we got that done , However we want a border strip top and bottom of the pages to span full width whatever the screen size , so we had a go with the 100% table width and it seemd to work .
But if we view on 15" screen all seems OK however in a bigger size , say 19" the borders are just a few pixels short on the RH side the crazy thing is that if you hit refresh button hey presto full span

Maybe we need to Gen up on our hard coding

Tnx

Richard

motorwatchercounter
01-02-2005, 01:04 PM
Strange. Possibly the order in the coding. This may simplyfy things. I haven't tried it but it must be worth a go.

http://www.digi-dl.com/seo/scripts/reload-refresh-once.html

:lol:

It may double up the number of hits though!!!!

activewebs
01-02-2005, 02:02 PM
Thanks For the help Motor :D we will give the script a go and let you know

Richard

Nomad
01-02-2005, 02:23 PM
Doesn't momo have that on his site? I seem to remember the page would load, show a 404 banner in the page, after like 10secs, the page would reload, only the once and the banner would change?

Don't like it myself...If I want my browser to reload that is my choice and essentially you are messing with the browsers main controls. Can't see any reason why you can't just load a page and be done with it.


I've seen it done at places but would really like to know why?

Arne
01-02-2005, 02:27 PM
Heres why we need to do this -
We are building a site and we want the pages to center in browser , OK we got that done , However we want a border strip top and bottom of the pages to span full width whatever the screen size, so we had a go with the 100% table width and it seemd to work .
But if we view on 15" screen all seems OK however in a bigger size , say 19" the borders are just a few pixels short on the RH side the crazy thing is that if you hit refresh button hey presto full span
Maybe we need to Gen up on our hard coding

I really don't see the need of any kind of refreshing the page for that. But it's nessecery to remove all margins and paddings in the table, the table cell and also for the body. I find it easier to do with CSS and have e.g. this in the CSS file for a page for a top "border" strip
#heading {margin-top:0; padding:10px 0 5px 0; text-align:center; background:#ffcc66;}

If you don't have an external CSS file, set it inline as a div, directly after <body>
<div style="margin-top:0; padding:10px 0 5px 0; text-align:center; background:#ffcc66;">Some content if you like, or leave it emty</div>

Do the the same thing for the bottom of the screen (under the table). You can of cause "play" with the pixel amounts and the background color so it fits what you like to have. As you see, there is no need to set anything for width, since the div will go from left to right as long as there is space to fill on the screen.

motorwatchercounter
01-02-2005, 02:55 PM
Hi Nomad,

I don't know if Momo has it. I got it from a Google search. Not the kind of thing I would use as I can't see a good use for it.

:lol:

activewebs
01-03-2005, 02:30 PM
Thanx Guys

The script works motowatcher , but I must admit its a bit of a hammer to crack a nut , got us out of a hole though ,I Think we may well end up using the suggested code later. :)

Any Way thanks all for your help

Cheers Richard