+ 1

How to hide responscode at the top of body. The responcode message show if i press enter button to comment.

but if im using mouse click the message doesnt show. can someone help me?

25th Feb 2017, 8:05 AM
フェリー
フェリー - avatar
6 Antworten
+ 4
no one can help you without knowing the code. please show us your code.
25th Feb 2017, 9:00 AM
Mario L.
Mario L. - avatar
0
maybe, but how i share the code, by using comentar . or link to pastebin?
25th Feb 2017, 9:03 AM
フェリー
フェリー - avatar
0
$(document).ready(function(){ 120. 121. $(".submitbtn").live("click",function(){ 122. var post_id = $(this).attr('postid'); 123. var comment = $("#comment_"+post_id).val(); 124. if(comment == ''){ 125. alert("comment can't be empty!"); 126. return false; 127. }else{ 128. $.ajax({ 129. type: "POST", 130. data: $('#commentform_'+post_id).serialize(), 131. url: ' <?php echo SITE_URL ; ?> /functions.php', 132. dataType: 'json', 133. success: function(response) { 134. if(response.ResponseCode == 200){ 135. $('#postbox_'+post_id).load(' <?php echo SITE_URL ; ?> /wall.php #postbox_'+post_id+' >*'); 136. }else{ 137. alert(response.Message); 138. } 139. } 140. }); 141. } 142. });
25th Feb 2017, 9:09 AM
フェリー
フェリー - avatar
0
this my js
25th Feb 2017, 9:09 AM
フェリー
フェリー - avatar
0
function submitPostComment ($Data ){ 71. $user_id = $_SESSION ['user_id' ]; 72. $post_id = $Data ['post_id' ]; 73. $comment = $Data ['comment' ]; 74. $date_created = date("Y-m-d H:i:s" ) ; 75. 76. $result = mysql_query("INSERT into fb_comment(post_id,user_id,comment,comment_date) values(' $post_id ',' $user_id ',' $comment ',' $date_created ')" ); 77. 78. if ($result ){ 79. $Return = array (); 80. $Return [ 'ResponseCode' ] = 200 ; 81. $Return [ 'Message' ] = "comment submitted successfully." ; 82. }else { 83. $Return = array (); 84. $Return [ 'ResponseCode' ] = 511 ; 85. $Return [ 'Message' ] = "Error : Please try again!" ; 86. } 87. 88. echo json_encode ($Return ); 89. }
25th Feb 2017, 9:10 AM
フェリー
フェリー - avatar
0
and my functions
25th Feb 2017, 9:10 AM
フェリー
フェリー - avatar