Just Another Dang Blog

A tech blog on IT, web development, graphic designs, freelancing, making money online and seo.
Welcome to lopau.com - a digital playground, online portfolio and blog of Paulo Orquillo
  • Home
  • About
  • Portfolio
  • Hire me
  • Templates
« Sticky Footer
Windows 7 launches November 7 in the Phillipines »
Oct 24
Ajax caching issue with IE workaround

If you’ve been developing websites I’m sure you pretty feel a little nausea from browser refreshing after an operation and prefer to work with AJAX for updating, deleting or loading some data from your DB with out the page reloading.

Most commonly used is http request is GET, your script runs flawlessly with Firefox, Chrome and Safari however on IE7 & and IE8 you don’t see the updates. This is because IE 7 and IE 8 treat GET request differently than POST, if there is no change from the last call it will always load up from it’s cache.

The workaround to the issue is pass an ever changing variable to the GET request like the current timestamp or date.

1. You can pass it on the ajax function call by adding an extra parameter time on the ajax call on the page.

ajaxify(x,<?php echo time(); ?>); // ajaxify(keywords, rand_time)

Then on your ajax function xmlHttp request call the rand_time parameter

xmlHttp.open(“GET”,”includes/ajax_page.php?dontcacheme=” + rand_time +”&keywords=”+keywords,true);

2. Or just create the random string using a Javascript Date class.

xmlHttp.open(“GET”,”includes/ajax_page.php?dontcacheme=” + new Date().getTime() +”&keywords=”+keywords,true);

This workaround worked well with my ajax scripts. Hope it helps.

Related posts:

  1. Submit a Form using Enter Key

This entry was posted on Saturday, October 24th, 2009 at 9:15 pm and is filed under Javascript. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply

  • Recent Posts

    • Fixing power problems with your LG Flatron Monitor (LG1753S)
    • Force Update your HTC Hero (GSM)
    • App Inventor for Andriod
    • Object Relationships and Fields
    • Force.com Custom Objects
  • Recent Comments

    • ForcePrepare: A new resource on Force.com Developer Certification. It contains free tutorials and mock exams.
    • ForcePrepare: A new site on SalesForce Developer certification has been recently launched –...
    • htc hero: Does anybody know which kind of video recordsdata are supported? I remember the Intuition solely might dl...
    • lopau: its really a matter of preference and OS of choice. Andriod or IOs 4.0. Because of the competition they bring...
    • Benjamin Hall: anyone who makes money on the internet would love to know the secret of John Chow’s...
    • Sony BDPS370: Having spent loads of time reading many of the great blog posts about some of the HTC phones, this one...
  • Proudly Pinoy!
  • Add to Technorati Favorites
  • Web Development & Design - Top Blogs Philippines

  • Categories

    • Adsense
    • Airsoft
    • Android
    • apple
    • Blogs
    • Browsers
    • Cloud Computing
    • CSS
    • Desktop Publishing
    • Facebook
    • Firefox
    • Flex
    • Fonts
    • Free WP Templates
    • Freelance
    • Google
    • Hardware
    • HTML 5
    • iPhone
    • IT
    • Javascript
    • microsoft
    • Online Scams
    • Others
    • Personal
    • Photography
    • Photoshop
    • PHP
    • Political
    • Projects
    • SalesForce
    • Security
    • SEO
    • Social Marketing
    • Travelling
    • Tutorials
    • WAMP
    • Web Resources
    • Wordpress
  • Archives

    • July 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
  • Blogroll

    • Abiel Online
    • Abiel's Tech Blog
    • Copongcopong’s Notes from Walk the walk
    • Get Rich Talks
    • Javi’s Go Blog
    • The Passionate Pilgrim’s Musings and Ramblings
    • Tinokla’s Scribbles and Doodles
  • Links

    • LS Blogs
    • Pampanga Province Websites
    • Top Blogs Philippines
    • Travel and Gobble
  • Tags

    Adsense among ed andriod apache apple blogging Blogs Cloud Computing CSS cuil development earn online enable gd library Firefox Fonts Freelance Google google analytics government increase traffic internet fraud internet scams iPhone knol knowledge content Money mysql online purchase pagerank page rank PHP politics pr search engines SEO social media content social networks text browser themes web design web developer web traffic western union Wordpress zend certification

Just Another Dang Blog is proudly powered by WordPress
Entries (RSS) and Comments (RSS).
Valid XHTML 1.0 Transitional Valid CSS!