473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Issue retrieving data from ajax call to coldfusion page in IE (firefox works fine)

219 100+
I have a page where I'm using ajax to retrieve some employee info when a user clicks a "Retrieve Employee Info" button.

The issue I'm having is that when the user updates the employee info, saves the data, then hits the retrieve employee info button again the data being retrieved is the original data, not the updated data. This only occurs in any IE browser, firefox works fine. In firefox everytime I hit the retrieve employee info button, the correct info is retrieved. It's almost like it's cached the response from the coldfusion page and isn't calling it again.

I am validating the data by using the alert box in the function below.

****This works fine in Firefox******

Expand|Select|Wrap|Line Numbers
  1. function displayResponse(request,func) {
  2.   //alert(request.readyState);
  3.   if (request.readyState == 4) {
  4.     if (request.status == 200 || request.status == 304) {
  5.       if (request.responseText.length>0){
  6.           init_employee(request.responseText,func);
  7.           alert(request.responseText);
  8.       }
  9.       else{
  10.           alert("No Employee Found!");
  11.         var emp_answer = confirm("Would you like to create a new employee");
  12.         if(emp_answer==true){
  13.             init_employee('invalid')
  14.             window.open ("employee_mgmt.cfm","mywindow",'height=350,width=725');
  15.         }
  16.       }
  17.     }
  18.   }
  19. }
  20.  
Expand|Select|Wrap|Line Numbers
  1. <cfquery name="employeeExists" datasource="Performance_Eval" dbtype="ODBC">
  2.     select last_name,first_name,dept,title,job_code,convert(char(10),date_of_hire,101) as 'date_of_hire'
  3.     from employee 
  4.     where emp_id='#URL.emp_id#'
  5. </cfquery>
  6. <cfif #employeeExists.RecordCount# neq 0>
  7.     <cfoutput query="employeeExists">#last_name#,#first_name#,#dept#,#title#,#job_code#,#date_of_hire#</cfoutput>
  8. </cfif>
  9.  
Jul 1 '08 #1
3 2112
acoder
16,027 Expert Mod 8TB
This is the typical IE caching problem. Make the URL unique to prevent caching, e.g.
Expand|Select|Wrap|Line Numbers
  1. url+"?d="+(new Date).getTime()
Jul 1 '08 #2
dmorand
219 100+
This is the typical IE caching problem. Make the URL unique to prevent caching, e.g.
Expand|Select|Wrap|Line Numbers
  1. url+"?d="+(new Date).getTime()
Cool thanks acoder, let me give this a shot. I can't stand IE, it pisses me off.
Jul 2 '08 #3
acoder
16,027 Expert Mod 8TB
Did this work? If not, setting some headers may also solve the problem.
Jul 3 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
by: whreed | last post by:
I am using AJAX XMLhttprequest to request another page on form submit and I am loading that page into a span tag. My issue is that I have more js in the called page that loads a calendar on click...
6
by: Nico VanHaaster | last post by:
Hello all, I have run across an issue with IE 6.0+. I have a page that makes an XMLHttpRequest to the webserver to update a report on the page. The first time you hit the refresh report button...
2
by: JDeats | last post by:
>From my development envrionment (i.e. a single WinXP notebook PC) I have a basic AJAX application that is making the call to a Windows Form page that just returns the request back to the AJAX...
1
by: wpt394 | last post by:
I am running a code that works just fine in Firefox, but seems to have trouble in IE. The basic idea is that a travel search process is initiated with one ajax call, and a 2nd ajax call 'updates'...
4
by: dmorand | last post by:
I'm curious as to how you all pass data back to the calling page when using AJAX. I have a button on a page which when clicked calls a coldfusion page to perform a query to retrieve some employee...
6
by: KDawg44 | last post by:
Hi, My responseXML is always null on my AJAX call. When I browse directly to the PHP script I am calling, the XML file shows up just fine. I have read that if a returned XML file is not...
2
by: burtonfigg | last post by:
I'm testing an ajax page - this works fine in Firefox: http://jimpix.co.uk/clients/a/ecards/defaultx.asp Click on any of the links on the right under the 'occassions' or 'others' headings, in...
1
by: fidgen | last post by:
Hiya, I'm trying to get a AJAX driven update to my list of news articles, so when users click the title of the news article, it pops up the article content in a thickbox overlay. Retrieving...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.