Modal Window Caching

Posted by Grubersauce

So you just implemented that neat new window fix to share the parent page's session... but it doesn't seem to update when data changes.  WTF mate?  Those modal windows love to cache.  Here's a quick fix:

 var linkURI = linkToOpen + "&random=" + (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);

Appending an unused querystring parameter which is different each time (for the most part) will prevent the new page from loading from the cache.  I know this isn't a TRULY random number or guid, but it should do the trick.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Posted on: 12/3/2009 at 5:47 AM
Tags: , , , , , ,
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Post RSSRSS comment feed

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading