Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
2.0k views
in Q2A Core by

When I click the Add Comment button, it sometimes doesn't appear to do anything, but internally the comment has been added. When I click it again, I get a message that states, "it appears this is a duplicate" and the screen refreshes.

Happens in IE8 and IE9.

Q2A version: 1.5.1
by
It's a JavaScript error in this code:

n.replace.call(f.slice(e.index),a,function(){for(var c=1;c<arguments.length-2;c++)if(arguments[c]===undefined)e[c]=undefined})

The problem is that f.slice() is undefined.

This is with Question2Answer installed alongside WordPress 3.3.1. I tried it with both the Default theme and the Candy theme (same results).
by
I get something similar in any browser, because there is a delay between clicking the button and the comment getting added, with no indication it's doing something.
by
edited by
If I remove lines 395-398 from qa-include/qa-page-question.php, the JavaScript error goes away, but I still get the bad behavior in the original post.
by
I belive I have the same problem as DisgruntledGoat, with a long delay (> 10 sec). I do not have WordPress installed, and the problem appears in both IE and Chrome (not tested other browsers).
by
Where is this code that begins n.replace.call(...) - in which Javascript file?
by
I believe it's in jQuery code. The problem is that "f" in f.slice(...) is an integer.  Since it's obfuscated, I don't know how to find the code.
by
OK, that makes sense. Please try substituting the latest jQuery version in qa-content (rename it the old jquery-1.7.1.min.js file name for now) and seeing if that fixes the problem, then please let me know.
by
Updating to jquery 1.7.2 eliminates the bad behavior in the original post.  It does not solve the f.slice() problem.  If I comment out lines 395-398 in qa-page-question.php, Question2Answer works for me.
by
I'm afraid I can't reproduce this here with IE8. Can you post a link to your own site, along with the extra steps to reproduce, so I can take a look there?
by
reshown by
Sorry, our site is behind a firewall. I'll see what else I can do.
by
edited by
@gidgreen we're seeing the same issue, but with IE 9.  Have not tested with IE 8 yet.  We are also behind a firewall, I'm afraid.  I do think the f.slice error appears when I try to post a comment with too short a length.  The Jquery error pops in the status bar but Question2Answer still appears to run and presents you with the error message about your post being too short.
by
Is this problem still happening on this site? I'm don't seem able to reproduce it. This may be because jQuery has been updated to 1.7.2.
by
I have not seen either error since upgrading to the latest JQuery (at the time, 1.7.2).

Please log in or register to answer this question.

...