You are here: Re: Preventing Browser-caching between Frames « PHP Programming Language « IT news, forums, messages
Re: Preventing Browser-caching between Frames

Posted by Erwin Moller on 12/16/37 11:58

bvdb wrote:

> Hello,
> my web-application uses two frames, one with a list of database
> records, one with a record detail view. From the detail view there is
> "mark" function that will mark the respective record in the list frame
> (with a special color).
> Now this mark function is meant to toggle the mark status in the list
> frame, i.e. switch it on with the first click and off with the second.
> Problem is, the marking works, but the second click will not have any
> effect. Only when I click on another link in the list frame and _then_
> click "mark" again will the marking be switched off.
> I assume this is due to the browser caching the request, and when it
> gets two times the same request (i.e. "list_records.php?marknode=42"),
> just ignores the second one. All no-cache parameters are already set in
> the headers, like:
> header("Cache-Control: no-store, no-cache, must-revalidate");
>
> (as described in the PHP manual), but this doesn't seem to work.
> Or maybe the described behaviour is based on something else?
> Thanks for hints!

Hi,

[Why not post this is a Javascript newsgroup?]

Two things:
1) You didn't describe how you detect the click.
Try using the onClick-event handler in Javascript to test is your browser is
missing clicks. Just make a function that says hello.
<span onClick="alert('I am clicked');">some record</span>

2) Caching. *IF* this is a caching-issue, just append some timestamp to the
url to prevent caching.
From php:
<a href="detailedview.php?recordid=<?= $recordid ?>&t=<?= microtime() ?>">
recordlink here</a>

I just made up the recordid, I guess you managed that part already.
The addition t=543289765983475 makes sure every url is different each time.
That will prevent retrieving cached records.

Hope that helps.
If not, post some examplecode.

Regards,
Erwin

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация