Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function getphp(hora) {
- $.post("page.php",
- {'value': 2, 'plus': 4},
- function(data,status){
- alert("value = "+data[0]+"+4="+data[1]+" - "+status);//data.length
- }, "json");
- }
- </script>
- </head>
- </html>
- //page.php
- <?php
- $val1= $_POST['value'];
- $val2 = $_POST['plus'];
- $re = array();
- $re[0] = $val1;
- $re[1] = $val1+$val2;
- echo json_encode($re);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement