Helpful Information
 
 
Category: Ajax and Design
prototype IE issues

Hey guys,

I've started to update existing applications with some ajax stuff using Prototype... it's been fine working in IE and Firefox - but just recently IE has started acting up a little.

Here's some basic coding I'm using..



var url = 'files/query_something.php';
var pars = Form.serialize($('form_data'));
var success = function(t){ alert("all ok"); }
var error = function(t) { alert("ERROR"); }
var myAjax = new Ajax.Request(url, {method: 'post', parameters: pars, onFailure: error, onSuccess:success });


it all works 100% a-ok in firefox, but Internet explorer is hit and miss! It works sometimes, then othertimes just submits and nothing comes back.

any ideas what I can do??
Maybe add some debugging... ? has anyone else had this problem?!

Perhaps try appending the current date/time to the parameters sent in the request. This will ensure that IE will pick up the fact that it is a new request, often times if the same parameters are passed multiple times, IE caches it somehow, somewhere and stops getting new data.

Not sure if that's your problem, but worth a shot.

Here is an example, make note of the code at the very end:
http://www.codingforums.com/showthread.php?t=109331#4

I'm going to move this to the new Ajax forum.

ok cool thanks - I'll give that a shot. So prototype is ok to go forward using? Or would you recommend using my own request code, or something like you posted in the other thread?

Cheers :)

When I was doing research on javascript libraries, Prototype had by far the highest number of users so I suspect they are doing things fine. I'm actually going to start using it in the next month so I sure hope I'm right. :)

As for the problem, it could be caching although it is an odd symptom unless there are times when the ajax request is supposed to return nothing. So when you say it is returning nothing, what alert message is it giving? Success? Error? No alert? I suspect more debugging is in order.

david_kw

I really suggest getting http://www.amazon.com/Prototype-Scriptaculous-Quickly-Dave-Crane/dp/1933988037 when it is released.

Eric










privacy (GDPR)