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>
Also in JavaScript:
- multilone input react
- summernote mentions ajax
- javascript get filename from url
- transpose of the matrix in javascript
- get data from fetch api into variable
- drupal 8 render node programmatically
- duplicate encoder
- js object to querystring
- background image with styled components
- get the whole value of a number javascript
- adding styling to element using javascript
- new date() javascript
- angularjs filter array of objects based on name prop
- url decode javascript
- how to find out what a string ends with in javascript
- jquery on window ready
- how to check no internet connection in jquery mobile phone
- split string into char array javascript
- javascript setattribute onclick function with parameters
- javascript check if a value is a integer number
- get date in javascript
- requestAnimationFrame without loss context angualar
- jquery fedein background color
- document.querySelector