Solved

jQuery / Prototype bugs in IE

Posted on 2007-11-16
3
452 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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When you need to keep track of a simple list of numbers or strings, the Array object is your most direct tool.  As we saw in my earlier EE Article (http://www.experts-exchange.com/A_3488.html), typical array handling might look like this: (CODE) B…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now