Call function when exiting browser? |
[eluser]CappY[/eluser]
Is there way user to call function when exiting browser? More special -> i want all to clear all DB Caches when user close website or exit browser. And is there way to cache just one or few query ? $this->db->cache_on(); -- query -- $this->db->cache_off(); ?
[eluser]Mareshal[/eluser]
do it using javascript,an send a request to a specific page
[eluser]BrianJM[/eluser]
[quote author="Mareshal" date="1297202692"]do it using javascript,an send a request to a specific page[/quote] I don't believe this is possible with JavaScript.
[eluser]Eric Barnes[/eluser]
It is possible but not sure if it is reliable across all browsers: http://www.4guysfromrolla.com/demos/OnBe...dDemo1.htm Basically use that to then call an ajax method to do your cleaning.
[eluser]BrianJM[/eluser]
[quote author="Eric Barnes" date="1297304074"]It is possible but not sure if it is reliable across all browsers: http://www.4guysfromrolla.com/demos/OnBe...dDemo1.htm Basically use that to then call an ajax method to do your cleaning.[/quote] That method does not distinguish between closing the page and refreshing it. Just something to consider.
[eluser]Jaketoolson[/eluser]
I agree with InsideFX - add a destructor to your class. As a side note, there are ways using Javascript to process data when leaving the page (either going to new page, refreshing, or closing browser). I coded this for a data sensitive project where we had to be certain the user was aware they were leaving/closing the page. |
Welcome Guest, Not a member yet? Register Sign In |