Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 485
  • Last Modified:

jQuery / Prototype bugs in IE

I use jQuery 1.2.1 and Prototype 1.5.1 libraries for some effects when deleting records from the database.  I have noticed it does not return the second callback response for all versions of IE - 5, 6 & 7 so i do not get my last effect occuring...

This is a bug or am I doing something wrong?  I have tested the script on a number of other browsers and it all works fine...so i guess it is an issue with Micro$lop browser - IE...

See my code below:
function removeRow(eid,mid) {
	var myAjax = new Ajax.Request("delete-email-alert.jsp?eid=" + eid, {
		method:'get',
		onSuccess: function(callback) {
			var object = new Ajax.Request("count-email-alerts.jsp?mid=" + mid, {
				method:'get',
				onSuccess: function(callback) {
					if(callback.responseText == 0) {
						$("#"+eid).fadeOut("slow", function() {
							$(this).html("<div class=\"col-empty\">All email alerts have now been deleted!</div>").fadeIn("slow");
						});
					} else {
						$("#"+eid).fadeOut("slow").slideUp();
					}
				}
			});
		}
	});
}

Open in new window

0
ellandrd
Asked:
ellandrd
2 Solutions
 
gops1Commented:
It is because of IE browser caching all responses from XMLHTTPRequest:

referf this place, it mentions the solution for this:

http://en.wikipedia.org/wiki/Xmlhttp#Microsoft_Internet_Explorer_cache_issues
0
 
MorcalavinCommented:
This issue can occurr with other browsers as well.  I use a Math.random() or Date() to make the urls' unique:

"delete-email-alert.jsp?eid=" + eid + "&cache=" + Math.random()

Open in new window

0
 
ellandrdAuthor Commented:
Cheers guys - i was unaware of the caching issue in IE...

Works perfect now.

Ellandrd
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now