View Full Version : Resolved Javascript in Ajax response is only evaluated SOMETIMES

08-20-2008, 08:53 PM
I'm working on a wiki-type application that allows users to embed RSS feed widgets into a page. Under normal circumstances, everything works properly, but if someone attempts to embed say 10 or more of these widget then things go a little hay-wire.

Here's how it works. Using lowpro, it fires off ajax requests after the page loads and evaluates the response which replaces a uniquely identified div with the contents of the feed.

For some reason, when there's a bunch of these widgets on a page, the javascript response isn't always evaluated. The weird thing is that its totally random. Sometimes all of the responses will get evaluated properly, and sometimes only maybe two of them will.

I haven't witnessed any JS errors on the page, and all of the responses seem to be fully intact. I'm somewhat inexperienced in the realm of js and ajax, so I'm quickly running out of ideas.

Can anybody think of any reason why the response might not always get evaluated?

08-21-2008, 01:25 AM
We're going to have to see some code or a link here. It could be a number of reasons. Also I suggest installing firebug; you can see all the AJAX queries and check if any of them failed or had some sort of an error.

08-21-2008, 01:43 AM
I figured it out. It turns out that one of the feed items contained a bit of javascript content that seemed to cause the unwanted behavior. Once I removed the feed widget for that particular RSS feed, then everything worked as expected.