PHP HTML Dynamic List From with Ajax
From w3cyberlearnings
Contents |
PHP Dynamic List uses Ajax
Create HTML LIST uses Ajax.
Example 1
page.html
<html> <head> <title>LIST</title> <script type="text/javascript" src="jquery.min.js"> </script> <script type="text/javascript"> $(document).ready(function() { $('div#actor_list').load('actors.php'); }); </script> </head> <body> <form> <div id="actor_list"></div> </form> </body> </html>
actors.php
<?php $actors = array( 'Greta Garbo', 'Andy Garcia', 'Ava Gardner', 'Lucy Johnson' ); echo '<ul>'; foreach ($actors as $actor) { echo '<li>'; echo $actor; echo '</li>'; } echo '</ul>'; ?>
Output
Related Links
Dynamic HTML From Array
Dynamic HTML From Database
Dynamic HTML with Ajax
- Dynamic Drop Down List with Ajax
- Dynamic List with Ajax
- Dynamic Radio with Ajax
- Dynamic Checkbox with Ajax
- Dynamic Form with Ajax
Others Related