• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

page refresh problem

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have following function in java script.

function timedRefresh(timeoutPeriod) {
setTimeout("location.reload();",timeoutPeriod);
}

Problem happens when Server doesn't return body content but returns SC_NOT_MODIFIED. Page get cleared in this case( No Content since response body is not there). I am not sure how to retain previous content in browser.

Thanks.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try making these changes:

setTimeout("window.location.reload(true);",timeoutPeriod);

Eric
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric, but this also not working.
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What browser was this in? Does it happen for all browsers? That code should tell the browser to fetch the resource out of its cache as it has not been changed on the server.
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,
Its IE6. I have not tested on other browsers. I too not sure why its happending. Does it has to do any thing with the way I am implementing my logic of returning 304? I am not using time stamps but comparing old data with new data. If no change then returning 304.
 
Bear Bibeault
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Aditya Singh:
I have not tested on other browsers.


Let us know what you discover when you do.
 
Aditya Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear for response. I changed the design to Applet-Servlet interaction. I feel using java inbuilt classes gives more control to programmer. We were targeting IE6 and could not find time to test on other browser.

Regards,
Aditya
 
reply
    Bookmark Topic Watch Topic
  • New Topic