use ajax request to controller method - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:ajax

Description

use ajax request to controller method

Demo Code

ResultView the demo in separate window

<html>
 <head></head> 
 <body> 
  <script src="https://code.jquery.com/jquery-1.11.1.min.js" type="text/javascript"></script> 
  <script>
        function reloadSmall() {/*from  w  w  w.  j  a  v  a  2 s  .c  o  m*/
            $.get("your api url", function(response) {
                $("#smallContent").html(response);
            });
        }
    
      </script> 
  <div id="smallContent" style="background: green"></div> 
  <button onclick="reloadSmall()">Click me</button>  
 </body>
</html>

Related Tutorials