Answers for "consumir rest jsp"

0

consumir rest jsp

<html>
    <head>
        <title></title>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
        </script>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
        <h2>Calcular factorial</h2>
        Número:<input type="text" name="base" id="base"/>
        <button type="button" id="calcularBtn">Calcular</button>
        <div id="resultado">
            Resultado: <span></span>
        </div>
        <script type="text/javascript">
            jQuery("#calcularBtn").click(function(){
                var base = jQuery("#base").val();
                jQuery.get("http://localhost:8080/SimpleRESTweb/resources/factorial",{
                    base:base
                },function(resultado){
                    jQuery("#resultado span").text(resultado)
                })
            })
        </script>
    </body>
</html>
Posted by: Guest on August-28-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language