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******
[code=javascript]
function displayResponse (request,func) {
//alert(request.r eadyState);
if (request.readyS tate == 4) {
if (request.status == 200 || request.status == 304) {
if (request.respon seText.length>0 ){
init_employee(r equest.response Text,func);
alert(request.r esponseText);
}
else{
alert("No Employee Found!");
var emp_answer = confirm("Would you like to create a new employee");
if(emp_answer== true){
init_employee(' invalid')
window.open ("employee_mgmt .cfm","mywindow ",'height=350,w idth=725');
}
}
}
}
}
[/code]
[code=html]
<cfquery name="employeeE xists" datasource="Per formance_Eval" dbtype="ODBC">
select last_name,first _name,dept,titl e,job_code,conv ert(char(10),da te_of_hire,101) as 'date_of_hire'
from employee
where emp_id='#URL.em p_id#'
</cfquery>
<cfif #employeeExists .RecordCount# neq 0>
<cfoutput query="employee Exists">#last_n ame#,#first_nam e#,#dept#,#titl e#,#job_code#,# date_of_hire#</cfoutput>
</cfif>
[/code]
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******
[code=javascript]
function displayResponse (request,func) {
//alert(request.r eadyState);
if (request.readyS tate == 4) {
if (request.status == 200 || request.status == 304) {
if (request.respon seText.length>0 ){
init_employee(r equest.response Text,func);
alert(request.r esponseText);
}
else{
alert("No Employee Found!");
var emp_answer = confirm("Would you like to create a new employee");
if(emp_answer== true){
init_employee(' invalid')
window.open ("employee_mgmt .cfm","mywindow ",'height=350,w idth=725');
}
}
}
}
}
[/code]
[code=html]
<cfquery name="employeeE xists" datasource="Per formance_Eval" dbtype="ODBC">
select last_name,first _name,dept,titl e,job_code,conv ert(char(10),da te_of_hire,101) as 'date_of_hire'
from employee
where emp_id='#URL.em p_id#'
</cfquery>
<cfif #employeeExists .RecordCount# neq 0>
<cfoutput query="employee Exists">#last_n ame#,#first_nam e#,#dept#,#titl e#,#job_code#,# date_of_hire#</cfoutput>
</cfif>
[/code]
Comment