Ask your JavaScript questions! Pay money and get answers fast! (more info)

"post reply" link no longer works? JavaScript


I am having this problem in both Chrome and FireFox on a Macintosh. Is anyone else having this problem?

I think the "post reply" link, on this site, just broke, during the last few days? I'm trying to respond to people in the other active thread, and when I click "post reply" the reply box opens and closes, almost as if I just clicked the link, and then clicked it again. See screenshot.

Any thoughts about what is causing this?

I see no errors in the FireBug console.

The only change I have made to the Javascript (in months) has been the inclusion of the Ajax call that pings

<script type="text/javascript">
function i_am_logged_in() {
url: "",
data: {
username: "lawrence",
first_name: "Lawrence",
last_name: "Krubner",
user_image: "lawrence_phpcev4Z5.jpeg",
site: ""
jQuery(document).ready(function($) {
setInterval("i_am_logged_in()", 8000);
setInterval("who_is_logged_in()", 8000);

I don't see that as likely to break anything.

Answers (3)


Christianto answers:


Is this happen only on
Because on this site I saw 2 different js files from different url that almost identical.

Both contain this code:
$('div.answer a.answer_thread_reply_link').each(function() {
$(this).click(function() {
var relId = $(this).attr('rel');
var idOfHiddenDiv = "answerExpanded-section" + relId;
$('#' + idOfHiddenDiv).toggle("slow");
var currentUrl = location.href;
// remove the anchor attached the last time someone clicked on something
var locationOfAnchor = strpos (currentUrl, "#");
if (locationOfAnchor > 0) currentUrl = substr(currentUrl, 0, locationOfAnchor);
var urlWithAnchor = currentUrl + "#" + idOfHiddenDiv;
location.href = urlWithAnchor;
return false;

I think it get fire twice because of this duplication.
it bind the event twice to same element.

Lawrence Krubner comments:

Nice catch! I made the change and uploaded it to the server and now everything is fixed! And I am using the 'post reply' box to reply to you. Nice job!


Utkarsh Kukreti answers:

That cannot break it.

Possible to get access to an account which has posted a question, so I can test the "Reply" button? On a test site perhaps?


Ross Wilson answers:

Can you post the code that opens the reply box?