-
Website
http://blog.disqus.com/ -
Original page
-
Subscribe
All Comments -
Community
-
Top Commenters
-
donnacha | WordSkill
37 comments · 12 points
-
Jason
164 comments · 22 points
-
Daniel Ha
2198 comments · 405 points
-
Rob Loach
45 comments · 29 points
-
goodbloke01
95 comments · 1 points
-
-
Popular Threads
-
Disqus: The Official Blog - Vote + Comment on your Favorite X-mas flick at BBC's Radio Times!
6 days ago · 9 comments
-
Disqus: The Official Blog - Welcome AllThingsD to the Disqus Community!
2 weeks ago · 23 comments
-
Disqus: The Official Blog - Please Welcome paidContent to the Disqus Community!
2 weeks ago · 12 comments
-
DISQUS | Service Status - Everything is running normal
1 week ago · 7 comments
-
DISQUS | Service Status - Email notifications temporarily delayed to AOL based emails
1 week ago · 2 comments
-
Disqus: The Official Blog - Vote + Comment on your Favorite X-mas flick at BBC's Radio Times!
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