I ran into an error where the disqus comment block was not loading in the IE browser. Checking the javascript console, the disqus embed.js file was being loaded multiple times throughout page load in all browsers. In some browsers this didn't cause a problem but in IE it resulted in the comments never loading--the 'loading' graphic would just cycle endlessly. The console showed numerous javascript errors and warnings,
I am not certain the exact reason for this, but the disqus.js code was being executed several times during each page load. This loaded embed.js several times. embed.js doesn't like to be loaded several times; this resulted in errors in some cases.
I selected disqus area in content--it could be that various blocks etc all include a content area, resulting in multiple loads per page? Also I have various blocks loaded via ajax and the ajaxblocks module.
Fix is simple, just check that the function to load embed.js is run just once.
Here is one solution, it sets a variable 'disqus_loaded' to 1 after the embed.js is loaded. This goes in disqus.js about line 58
// Make the AJAX call for the comment thread.
if (typeof(disqus_loaded)=="undefined" || !disqus_loaded) {
disqus_loaded=1;
jQuery.ajax({
type: 'GET',
url: 'http://' + disqus_shortname + '.disqus.com/embed.js',
dataType: 'script',
cache: true
});
}
With this fix in place all seems to work well.
There may be a more essential fix needed, to determine why the disqus.js code is being executed multiple times in some situations.
FYI the error is similar or identical to that described here: https://groups.google.com/forum/#!topic/disqus-dev/SUo_xkngnfs - he saw these error messages and I saw similar ones in the console:
SCRIPT5007: Unable to get value of the property 'sendMessage': object is null or undefined
embed.js, line 1 character 7219
SCRIPT5011: Can't execute code from a freed script
embed.js, line 1 character 7657
Use DISQUS.reset instead of reloading embed.js please.
Comments
Comment #1
flug commentedComment #2
flug commentedComment #3
socialnicheguru commentedthis fix has to be reworked considering new code/version of disqus