Warning: Cannot use a scalar value as an array in /home/admin/public_html/forum/include/fm.class.php on line 757

Warning: Invalid argument supplied for foreach() in /home/admin/public_html/forum/include/fm.class.php on line 770
Форумы портала PHP.SU :: Версия для печати :: Пагинация на ajax
Форумы портала PHP.SU » » HTTP и PHP » Пагинация на ajax

Страниц (1): [1]
 

1. leshiy - 05 Января, 2018 - 16:01:05 - перейти к сообщению
Не могу сообразить что делать дальше что бы менялись +i+?Подскажите!
CODE (javascript):
скопировать код в буфер обмена
  1.  
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  7.                           <script>
  8.                         $(document).ready(function () {
  9.                                  var html_output = "";
  10.               for(i = 1; i <= 100; i++){
  11.                   if(i <= 8 && i > 1){
  12.               html_output += "<strong id="+i+">"+i+" </strong>";
  13.           }else if(i < 0 && i > 4){
  14.               html_output += "<strong id="+i+">"+i+" </strong>";
  15.           }
  16.                     pag.innerHTML = html_output;}
  17. $('#pag strong').on('click', function(){
  18. var bb = $(this).attr('id');
  19.                         $.ajax({
  20.                                                         url:'index.php',
  21.                                                         type:'GET',
  22.                                                         data: "page="+bb,
  23.                                                         success: function(html) {
  24. //
  25.                                 $("#pag").html(html);
  26.                                                         }});});});
  27. </script>
  28. </head>
  29. <body>
  30.               <div id="pag" name="ppp"></div>
  31.     </body>
  32. </html>

 

Powered by ExBB FM 1.0 RC1