After installing Intense Debate comments on my company’s blog, I noticed some unexpected behaviors while trying to login to Intense Debate from their comments thread. Upon clicking either login link, I was redirected to {baseUrl}/#idc-container. Either I had to remove the base tag from the site, thus having to change every url to an absolute url, or create a way around this using javascript.
Originally, I did remove the base url and create absolute urls for everyting. However, this created problems with creating relative links in the cms. I did create a way to fix that, but eventually I would turn back and go another route to fix the problem involving the base tag.
The original problem lay in the code inside of the showLogin function, which is what the href pointed to for logging into intense debate on the comments thread. The problem is when this function calls window.location = “#idc-container”.
function showLogin()
{
$id("IDCommentsHead").className = $id("IDCommentsHead").className.replace(/idc-signup/g, "").replace(/idc-openid/g, "").replace(/idc-openid_signup/g, "") + " idc-login";
$id("IDCommentsHeadLogin").className += " idc-sel";
//$id("IDCommentsHeadSignup").className = $id("IDCommentsHeadSignup").className.replace(/idc-sel/g, "");
window.location = "#idc-container";
$id("IDtxtLoginEmail").focus();
};I inserted the following javascript, with jquery, to fix this problem. I created my own showLogin replacement function titled showLoginFixed. I replaced the window.location with an abolute url. I created a function to get both of the login links and replace their href with “javascript: showLoginFixed();”. I also created an interval so that we can keep checking to see if intense debate has loaded yet, because I can’t replace the href’s on those links until they exist on the page.
var checkIdInterval = "";
function showLoginFixed() {
$id("IDCommentsHead").className = $id("IDCommentsHead").className.replace(/idc-signup/g, "").replace(/idc-openid/g, "").replace(/idc-openid_signup/g, "") + " idc-login";
$id("IDCommentsHeadLogin").className += " idc-sel";
//$id("IDCommentsHeadSignup").className = $id("IDCommentsHeadSignup").className.replace(/idc-sel/g, "");
//change from a relative url to an absolute url
window.location = "{absoluteUrl}#idc-container";
$id("IDtxtLoginEmail").focus();
};
function fixShowLogin() {
$("#IDCommentsHeadLogin, #IDCPostNav li a[href*=showLogin]").each(function() {
$(this).attr("href", "javascript: showLoginFixed();");
clearInterval(checkIdInterval);
});
}
checkIdInterval = setInterval(fixShowLogin, 1000);This solution makes the login links work the way they normally would without the user noticing that anything has gone wrong. There was some collaberation about this problem on GetSatisfaction.

Nice fix! Sorry you had to hack around our problem. If it's any consolation I think this is fixed for others as of today by replacing
window.location = '#idc-container';
with
window.location.hash = '#idc-container';
Which should already by live.
If you'd prefer not to poll to check when IntenseDebate loads, we offer some JavaScript hooks to detect that via our plugin system. There's more info here: http://www.intensedebate.com/docs/plugin-resource... but the basic idea is that you can register a JS function that we will fire on certain events (including IntenseDebate loading). Might be a slightly nicer solution if you're interested in poking around.
Again, sorry for the trouble, but nice job working around it!
I'll check that fix on my company's blog when I get in on Monday. Thanks for the reference, I'll definitely check that out.
Checked out the fix. Works great. Thanks.