Solved

jQuery / Prototype bugs in IE

Posted on 2007-11-16
3
458 Views
Last Modified: 2013-11-05
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
Comment
Question by:ellandrd
3 Comments
 
LVL 17

Accepted Solution

by:
gops1 earned 250 total points
ID: 20297754
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
 
LVL 18

Assisted Solution

by:Morcalavin
Morcalavin earned 250 total points
ID: 20297769
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
 
LVL 16

Author Comment

by:ellandrd
ID: 20297850
Cheers guys - i was unaware of the caching issue in IE...

Works perfect now.

Ellandrd
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question