Transfer data Javascript to PHP - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:post

Description

Transfer data Javascript to PHP

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js">
        <script type="text/javascript">
            if(confirm("click ok!"))
            {//from   w w  w.j  a  v a2s .c  om
                 $.post("myphpfile.php", {data: "ok"})
                       .done(function(data)
                            {
                                console.log(data);
                            });
            }
        
      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials