/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] I need help debugging my JQuery

Below is a script that (should) display a list of comments through AJax after a comment was posted.
After an user enters a comment and submits it using AJax, a list of comments with the new comment should be displayed. However, the first page of comments (without the new comment) is always displayed. I want the last page (with the new comment) to be displayed.

Here’s the code:

[CODE]function (c) {
var i = jQuery(“<div />”).plainHtml(c);
$comm = i.find(“#comments-wrap”).plainHtml();
jQuery(“ul#comments #cancel-reply”).hide();
jQuery(“ul#comments”).find(“#respond”).prependTo(“#section-comments”);
jQuery(“#comments-wrap”).plainHtml($comm);
d.empty();
d.attr(“class”, “success”).plainHtml($lang[1]);
jQuery(“#comment”).val(“”);
jQuery(“#submit”).val($lang[2]);
jQuery(“#submit, #comment”).removeAttr(“disabled”);
jQuery(“#comment_parent”).attr(“value”, “0”)

}[/CODE]

I’m not very good at Javascript/JQuery, can someone explain to me exactly what happens with this script?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@narutodude000authorMar 14.2011 — Nevermind, it was a PHP error.
×

Success!

Help @narutodude000 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...