Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://way2enjoy.com/app/jokestest-991-1.php
- $output .='<div id="'.$idd.'" align="left" class="messagelove_box" ><div class="content_box_1">
- <div class="content_box_2z"><sup class="joke_icon"></sup></div>
- <div class="content_box_3_title"></div>
- <div class="content_box_3_text">'.nl2br($cont).'</div>
- <script type="text/javascript">
- var ajaxSubmit = function(formEl) {
- var url = $(formEl).attr('action');
- var comment=document.getElementById("jokes_comment").value;
- var joke_id=document.getElementById("joke_id_hidden'. $idd.'").value;
- $.ajax({
- url: url,
- data:{
- 'action':'addComment',
- 'comment':comment,
- 'joke_id':joke_id
- },
- dataType: 'json',
- type:'POST',
- success: function(result) {
- console.log(result);
- $.ajax({
- url: url,
- data:{
- 'action':'getLastComment',
- 'joke_id':joke_id
- },
- dataType: 'json',
- type:'POST',
- success: function(result) {
- $('#jokes_comment').val("");
- console.log(result[0].description);
- $("#header ul").append('<li>'+result[0].description+'</li>');
- },
- error: function(){
- alert('failure');
- }
- });
- },
- error: function(){
- alert('failure');
- }
- });
- return false;
- }
- </script>
- <div id="header" class="content_box_31_text"><ul id="commentlist" class="justList">'.$contpp.'</ul></div>
- <form method="post" action="check/process2.php" class="button-1" onSubmit="return ajaxSubmit(this);"><input type="hidden" value="'. $idd.'" id="joke_id_hidden'. $idd.'"><input type="text" id="jokes_comment" value="" name="jokes_comment">
- <input type="submit" value="comment"></form>
- </div></div>
- ';
Add Comment
Please, Sign In to add comment