Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <center>
- <button id="button_loading" class="btn btn-default" onclick="showCommentPost()"><span class="fa fa-spinner fa-2x"></span> Carica altri commenti</button>
- <p id="loading" style="display:none;"><i class="fa fa-spinner fa-spin fa-5x"></i></p>
- <p id="all_comments" style="display:none;">Tutti i commenti sono stati visualizzati.</p>
- </center>
- <br><br><br>
- <script>
- var i = 1;
- var pst = <?php echo $id;?>;
- var com = <?echo $number_comm;?>;
- var pagination = <?echo $pagination;?>;
- alert(pst + " "+ " " +com + " "+pagination);
- alert("control/comments.php?post="+pst+"&comment="+com+"&one=<?php echo $password;?>");
- function showCommentPost() {
- if (pst == "") {
- document.getElementById("comments_show"+i).innerHTML = "";
- return;
- } else {
- if (window.XMLHttpRequest) {
- // code for IE7+, Firefox, Chrome, Opera, Safari
- xmlhttp = new XMLHttpRequest();
- } else {
- // code for IE6, IE5
- xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
- }
- xmlhttp.onreadystatechange = function() {
- if (this.readyState == 4 && this.status == 200) {
- hide_loading_Comment()
- show_loading_Circle();
- alert("documento prova" + pst + " "+ " " +com + " "+pagination );
- document.getElementById("comments_show"+i).innerHTML = this.responseText;
- alert("documento prova");
- if(i==pagination)
- {
- hide_loading_Comment();
- hide_loading_Circle();
- show_all_comments();
- }
- else
- {
- $(document).ready(function ()
- {
- alert("documento caricato ora mostro il tasto carica altro");
- hide_loading_Circle(); show_loading_Comment();
- });
- }
- i++;
- }
- };
- xmlhttp.open("GET","control/comments.php?post="+pst+"&comment="+com+"&one=<?php echo $password;?>",true);
- xmlhttp.send();
- }
- }
- function hide_loading_Comment() {
- var button_loading = $('#button_loading');
- button_loading.hide("fast");
- }
- function show_loading_Comment() {
- var button_loading = $('#button_loading');
- button_loading.show("fast");
- }
- function show_loading_Circle() {
- var loading = $('#loading');
- loading.show("fast");
- }
- function hide_loading_Circle() {
- var loading = $('#loading');
- loading.hide("fast");
- }
- function show_all_comments() {
- var all_comments = $('#all_comments');
- all_comments.show("fast");
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment