FastComments.com
Here you can edit and run the code snippet from our documentation.
Example Code Snippet "कॉलबैक उदाहरण"
<script async src="https://cdn.fastcomments.com/js/embed-v2-async.min.js"></script> <div id="fastcomments-widget"></div> <script> window.fcConfigs = [{ target: '#fastcomments-widget', tenantId: 'demo', onInit: function () { console.log('Library started to fetch comments!'); }, onAuthenticationChange: function (eventName, userObj) { console.log('User authenticated!', eventName, userObj); }, onRender: function () { console.log('Render event happened!'); }, commentCountUpdated: function (newCount) { console.log('New comment count:', newCount); }, onReplySuccess: function (comment) { console.log('New comment saved!', comment); }, onVoteSuccess: function (comment, voteId, direction, status) { console.log('New vote saved!', comment, voteId, direction, status); }, onImageClicked: function (src) { console.log('Image clicked!', src); }, onOpenProfile: function (userId) { console.log('User tried to open profile', userId); // return true; // डिफ़ॉल्ट व्यवहार (fastcomments.com यूज़र प्रोफ़ाइल खोलना) को रोकने के लिए true लौटाएँ। }, onCommentSubmitStart: function(comment, continueSubmitFn, cancelFn) { console.log('Trying to submit comment', comment); setTimeout(function() { // असिंक्रोनस व्यवहार (API कॉल आदि) का अनुकरण। if(confirm('Should submit?')) { continueSubmitFn(); } else { cancelFn('Some optional error message'); } }, 1000); }, onCommentsRendered: function(comments) { // comments पेज के डिफ़ॉल्ट सॉर्ट के अनुसार क्रमबद्ध हैं, जो Most Relevant (जैसे: सबसे अधिक अपवोट, आदि) या Newest First हो सकता है const topCommentInList = comments[0]; console.log('First Comment Rendered:', topCommentInList.avatarSrc, topCommentInList.commenterName, topCommentInList.commentHTML); } }]; </script>
Result