This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes use body onload refresh functionality only once Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "use body onload refresh functionality only once" Watch "use body onload refresh functionality only once" New topic
Author

use body onload refresh functionality only once

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hello ,

I have a jsp page which generates a image dynamically depending on the parameters passed to it.

There is a problem on to the page . That is

When the page is called for the first time an empty jsp page is displayed so we manually used to refresh the page .

so instead of manually refreshing the page i added body onload refresh functionality .

This works fine (Instead of manually refreshing )


Please tell me how can i use conditional refreshing .

Means i want to use body onload refresh functionality only once that is for first time and not every time the jsp page is refreshed .

Please tell me how to do this





Save India From Corruption - Anna Hazare.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Is this possible ??

My actual question is :

Is there a way to determine if a page was refreshed? I have a function that
is called when the page loads, but when the user refreshes the page it calls
the function again. Is there a way to call the function only when the page
initially loads? I don't want it to load when the user clicks the refresh
button.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi
i found the solution . If somebody has similar requirements . This is the code .
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I would figure out why it is empty the first time and avoid a refresh.

Eric
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

You mean to say that this code has bug and such kind of behaviour is not possible .
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9303
    
  17

Eric means that you should try to redesign your application such that there's no need to show an empty page and then refresh it. Actually even I'm not sure why that's required, I've never came across a situation where I had to show an empty page and refresh it...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
GeeCON Prague 2014
 
subject: use body onload refresh functionality only once