Jump to content

ASP Classic: Firefox works fine, IE loads cache of some sort?


allholy1

Recommended Posts

Hey guys,

 

I'm setting up a page similar to google calendar's share calendar feature where you can add a list of users.  When I add a person, it submits a POST request to an asp (classic 3.0) page which then sends the data over to a SQL 2005 database.  Next, the JavaScript code sends a POST request to get the newly submitted data, generated in JSON.  In Firefox, everything is perfect.  But in IE, it always loads the previous data.  Even if I enter a value using Firefox, then enter a new one in IE, it still loads the old value, even 10 seconds after the previous submission.  Once I submit again, it then loads the proper values.  I'm using the prototype.js library to perform all the AJAX requests.  I've spent so long trying to fix this  :(.

 

When one types in the name and e-mail and hit the add button, it calls this script:

 

function addPerson(theForm)
{	
        theForm1=document.getElementById(theForm);
person = theForm1.newAccessPerson.value;
person = trim(person);
address = trim(theForm1.newAccessPersonEmail.value);
if (person == null || person == '' || address == null || address == '')
	return;
else {
new Ajax.Request('signup.asp?group=65535&id=1&option=addnewperson', {
  parameters: $(theForm).serialize(true)
  });
  
  getNewPerson('json');
}
}

Next it adds to the database but I don't think I need to post that, so after that I send a request to get the new data with this function:

 

function getNewPerson(opt)
{
  
  new Ajax.Request('signup.asp?group=65535&id=1&option=' + opt,
  {
    method:'post',
    onSuccess: function(transport){
		var response = null;
      response = transport.responseText || "no response text";
      drawNewPerson(response);
    },
    onFailure: function(){ return('Something went wrong...') }
  });
}

 

Here's how the ASP page where the request is generated:

 

    sub json()
      response.Expires=-1
      pStr = "private, no-cache, must-revalidate" 
      Response.ExpiresAbsolute = #2000-01-01# 
      Response.AddHeader "pragma", "no-cache" 
      Response.AddHeader "cache-control", pStr 
      Response.Write("{""id"":""" & rs_RecordSet("ID") & """,""name"":"""& rs_RecordSet("Name") & """,""email"":""" & rs_RecordSet("EmailAddress") & """}")
    end sub

 

 

And finally, add the person to the table:

var person = null
person = html.evalJSON();

var x=document.getElementById('svalues').insertRow(0);
  var namecell=x.insertCell(0);
  var emailcell=x.insertCell(1);
var deletecell=x.insertCell(2);
  namecell.innerHTML=person.name;
  emailcell.innerHTML=person.email;
deletecell.innerHTML='<a href=\"javascript:deletePerson(\'' + person.id + '\')\"><img width=\"9\" height=\"10\" src=\"images/icon_delete.gif\" style=\"width: 9px; height: 10px;\"/></a>';

}

 

This happens in both versions 6 and 7.  Thanks in advance

Link to comment
Share on other sites

I tried it out today and the same exact thing is happening  :-[.  Could prototype not be compatible with IE completely?

 

var randnumber = Math.random(10);
var url = "/signup.asp?option=" + opt + "&randomnumber=" + randnumber;
new Ajax.Request(url,
  {
    method:'post',
    onSuccess: function(transport){
		var response = null;
      response = transport.responseText || "no response text";
      drawNewPerson(response);
    },
    onFailure: function(){ return('Something went wrong...') }
  });

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.