Advertisement
obernardovieira

[HTML+JS+PHP] Test (Alternative syntax)

Apr 13th, 2015
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4.     <meta charset="utf-8">
  5.     <style>
  6.     p {
  7.         color: grey;
  8.         font-style: italic;
  9.     }
  10.     </style>
  11.     <script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
  12.     <script>
  13.     <?php $texto = "Fim"; $max = 2; ?>
  14.     $(document).ready(function(e) {
  15.         for(var j=0; j!=<?php echo $max;?>; j++) {
  16.             $("body").append("<?php echo $texto.'<br>'; ?>");
  17.         }
  18.     });
  19.     </script>
  20. </head>
  21. <body>
  22.  
  23.     <?php for($v = 0; $v != 10; $v ++): ?>
  24.         <p>Olá <?php echo $v; ?></p>
  25.     <?php endfor; ?>
  26.  
  27. </body>
  28. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement