Asynchronous : false in IE gives problem

129 views
Skip to first unread message

dip

unread,
Nov 20, 2009, 3:04:03 AM11/20/09
to Prototype & script.aculo.us
Hi,

We are using prototype.js for our site.
Whenever we issue an ajax request , we show an image ("wait...") in
onCreate function and
remove this image in onSuccess() function.
Now for some reason,we need to make ajax request synchoronous,so that
until the call
ended ,user should not do anything.
So, we made aasynchronous:false.
This is working fine in FireFox but in IE(7) the image is just not
displaying.
what will the possible solution?

Alex McAuley

unread,
Nov 23, 2009, 10:27:44 AM11/23/09
to prototype-s...@googlegroups.com
Does IE throw an error at all ...

Possibly its somehting in your code.... pastebin your code so we can check
it out


Alex Mcauley
http://www.thevacancymarket.com
> --
>
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-s...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scripta...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=.
>
>
>

T.J. Crowder

unread,
Nov 23, 2009, 10:34:44 AM11/23/09
to Prototype & script.aculo.us
Hi,

Using asynchronous: false *really* locks up the UI in IE (and some
other browsers). In this case, even though you've told it to show the
image, it's probably not had time to actually do that (browsers
usually queue these things) before the UI locks because of the
synchronous call.

The best answer is probably not to use a synchronous call, but rather
to use an iframe shim or something to make everything on the page
unclickable while the call is in progress. Synchronous calls lock
*everything* UI-related in that IE process, not just your page,
whereas an iframe shim just makes your page unclickable (and provides
an opportunity for you to show things a bit dimmed-out or something).
It's also really easy.

If you can't do that, you may have to change your approach to showing
the image, because what you want to do is give the browser a chance to
process any UI updates before you lock it, which is easily done with a
setTimeout call (directly, or via one of Prototype's useful wrappers
like Function#defer and Function#delay; Function#defer is just
Function#delay with a 0.1 delay time). But you can't do that from
within the onCreate callback. Instead, you'd have to create a function
that you use to launch Ajax requests which shows the image, then
schedules the Ajax call to happen after a brief setTimeout/
Function#defer/Function#delay. Even then, be wary that your new
function triggering the request will return *before* the request is
triggered, because of the setTimeout/defer/delay.

HTH,
--
T.J. Crowder
Independent Software Consultant
tj / crowder software / com
www.crowdersoftware.com
Reply all
Reply to author
Forward
0 new messages