Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Javascript
- $(document).ready(function(){
- $("#akux").click(function(){
- $.ajax({
- type:"POST",
- url:"data/proses.php",
- data: "aksi=tampil",
- success: function(data){
- $(".hasil").html(data);
- }
- });
- });
- $("#akux2").click(function(){
- $.ajax({
- type:"POST",
- url:"data/proses.php",
- data: "aksi=tampil2",
- success: function(data){
- $(".hasil2").html(data);
- }
- });
- });
- });
- //index.php
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="">
- <meta name="author" content="">
- <title>Kecamatan Gununganyar</title>
- <script src="js/jquery.js"></script>
- <script src="js/jquery.min.js"></script>
- <script src="js/coba.js"></script>
- </head>
- <body>
- <input name="aku" type="button" value="AKU 1" id="akux">
- <div class="hasil"></div>
- <div class="hasil2"></div>
- </body>
- </html>
- //Folder Data (proses.php)
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta name="description" content="">
- <meta name="author" content="">
- <title>Kecamatan Gununganyar</title>
- <script src="js/jquery.js"></script>
- <script src="js/jquery.min.js"></script>
- <script src="js/coba.js"></script>
- </head>
- <body>
- <input name="aku" type="button" value="AKU 1" id="akux">
- <div class="hasil"></div>
- <div class="hasil2"></div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment