PDA

View Full Version : Ajax.Updater using prototype problem in IE7


jjrules
06-17-2009, 07:44 PM
Hi,

I have a PHP based application using symfony, in which I use a plugin to display sortable, filterable tables. The plugin works fine in Firefox, Chrome, Safari, and for some tables also in IE7.

In other cases IE is hanging on me. The tables are updated via Ajax using Prototype (all code generated by the plugin). I've sent correspondence to the plugin developer, but I'm trying to look into this also on my own. Here is the code for the ajax portion of the code:


<div id="browse_facilities"><div class="datagrid-loader" id="loader-browse_facilities">Please wait one moment</div></div><script type="text/javascript">
//<![CDATA[
new Ajax.Updater('browse_facilities', '/frontend_dev.php/browse_facilities', {asynchronous:true, evalScripts:true, onLoading:function(request, json){dg_hide_show('browse_facilities')}});
//]]>
</script></div>


What I see happening is the "Please wait one moment" message just keeps flashing forever. Also the page has a very convoluted appearance where the header is duplicated. I can see the browser's CPU is also high and it seems to be in some sort of infinite loop.

On a few occasions the table has rendered, and the header duplication rectifies itself. I got this to work once by navigating away from the page and then coming back. But in most cases this doesn't fix things.

I found some posts that said there can be issues if no height is given to the div tag. I tried adding a height to the outermost div (1200 px - even more than I need). But it displayed correctly the first time and then after that it kept giving me the same problem again and again.

Does anyone have any idea why this might be happening, and how I can go about debugging it or fixing it?

Thanks,
Steve

ohgod
06-18-2009, 04:51 PM
in the name of debugging you could throw in some more callbacks. you'd at least be able to see how far it's making it.

http://prototypejs.org/api/ajax/options

to look at what is being sent back and forth a little more in depth try temporarily swapping your Ajax.Updater for an Ajax.Request and viewing the transport. it would remove the Updater from the process and help isolate the problem.

jjrules
06-18-2009, 06:30 PM
Thanks - yeah I found a Firebug Lite plugin but it didn't really work for javascript debugging. I ended up just putting some alert statements in the code.

I can see that what happens is the script keeps getting called in an infinite loop. I read somewhere that this can happen with IE if the Ajax call doesn't have any parameters. So I stuck in a dummy parameter and it worked.

Steve

cmaxwellau
07-08-2010, 06:04 AM
I had a similar problem.

It turns out that in my case, the ajax response had a FORM element in it, and the destination of the updater was already inside a FORM element.

It worked fine in firefox, but not IE.