-
Website
http://blog.disqus.com/ -
Original page
-
Subscribe
All Comments -
Community
-
Top Commenters
-
donnacha | WordSkill
37 comments · 11 points
-
Jason
164 comments · 22 points
-
Mike Olbinski
88 comments · 17 points
-
Daniel Ha
2195 comments · 396 points
-
Rob Loach
45 comments · 27 points
-
-
Popular Threads
-
Disqus: The Official Blog - Disqus Comments: Translated in over 40 languages
5 days ago · 27 comments
-
Disqus: The Official Blog - Disqus Comments: Moderating comments from your Post
2 weeks ago · 68 comments
-
Disqus: The Official Blog - Disqus Comments: Closing comments on Wordpress and some bug fixes
4 weeks ago · 85 comments
-
DISQUS | Service Status - Maintenance window
19 hours ago · 1 comment
-
DISQUS | Service Status - Everything is back to normal.
1 day ago · 2 comments
-
Disqus: The Official Blog - Disqus Comments: Translated in over 40 languages
Sorry about the issues. The white screen is because of how jQuery
handles onDomReady.
Since Disqus needs to modify the DOM, there is a race condition with
jQuery's event listener. What ends up happening is that Disqus writes
to the page while jQuery is modifying the DOM and ends up writing over
the entire page (e.g. white screen).
This is not an issue with how the Disqus script is written. jQuery's
onDomReady reacts similarly with most applications that need to modify
the DOM. We've been working around this recently and hope to update
you on the matter soon.
Thanks.
Thanks in advance
regards
Figurative Paintings
The only feasible work around, I found so far is to split the embed.js apart.
The document.write in the embed.js basically just injects the stylesheet. Which can easily been pulled out and offered as separate file. I wonder why this is not a default option for embedding disqus, especially as some people use to alter the disqus theme by overwriting the css, in which case loading the base css is kind of pointless.
One problem persists though, if you split the embed.js apart, you get your forum id hardcoded into the js file.
Assuming you split the embed.js apart, you could do something like this, using jQuery:
if($("#disqus_thread").length) {
var head = document.getElementsByTagName('head')[0];
$(document.createElement('link'))
.attr({type: 'text/css', href: '/media/css/disqus.css', rel: 'stylesheet', media: 'screen'})
.appendTo(head);
$.getScript('/contrib/js/disqus.embed.js');
}
This obviously will only load the disqus script and style if the element with the id #disqus_thread exist and requires the head tag to be present.
You can take a look at it at:
http://journal.moritzangermann.com
the splitted files are (for convinience):
http://journal.moritzangermann.com/media/css/di...
http://journal.moritzangermann.com/contrib/js/d...
I've just implemented your mod on a test system ( where I'm trying out Disqus integration) and found this sped page loads considerably. Cheers
I just hope disqus will at one point integrate this.
Thanks for the plug-in. One issue though, it gives an error in IE6 + IE7, which can easily be fixed by removing the commas in line 70 and 95 of the jquery.disqus.js file. This is a typical IE issue and not the first time I run into this.
Keep up the good work!
Jasper