Top Questions

  • 5.11 Years

    • Category : Php
    • Location : Mohali
    • Posted On : Dec 8, 2015

    1 Answers

    View More

    admin

    admin

    5.3 Years

    Answered:

    Dec 8, 2015

    create file result.php

    <?php
    if( $_REQUEST["name"] ) {
    
       $name = $_REQUEST['name'];
       echo "Welcome ". $name;
    }
    
    ?>

    create your html file with this code

    <html>
    
       <head>
          <title>The jQuery Example</title>
          <script type = "text/javascript" 
             src = "http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
       
          <script type = "text/javascript" language = "javascript">
             $(document).ready(function() {
          
                $("#driver").click(function(event){
           
                   $.post( 
                      "result.php",
                      { name: "Zara" },
                      function(data) {
                         $('#stage').html(data);
                      }
                   );
             
                });
           
             });
          </script>
       </head>
     
       <body>
     
          <p>Click on the button to load result.html file %u2212</p>
        
          <div id = "stage" style = "background-color:cc0;">
             STAGE
          </div>
        
          <input type = "button" id = "driver" value = "Load Data" />
       
       </body>
      
    </html>

Add Your Answer

When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
Let's work to help developers, not make them feel stupid.