Download pool/shard006/JavaScript/0037654_formularioPut.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 908 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/JavaScript/0037654_formularioPut.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard006/JavaScript/0037654_formularioPut.js
-
curl -L -o 0037654_formularioPut.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard006/JavaScript/0037654_formularioPut.js
908 Bytes
| $(document).ready( | |
| function() { | |
| var dir = "api/v2/tiposenergias"; | |
| $('#Actualizar').click( | |
| function() { | |
| // PUT | |
| var dato = []; | |
| // coger datos de los input | |
| dato.push([ $('#country').val(), $('#no_fossil').val(), | |
| $('#fossil').val(), $('#temperature').val() ]); | |
| // console.log(dato); | |
| // console.log(dato[0][0]); | |
| var data = '{' + '"name":' + '"' + dato[0][0] + '"' | |
| + ',' + '"no_fossil":' + dato[0][1] + ',' | |
| + '"fossil":' + dato[0][2] + ',' | |
| + '"temperature":' + dato[0][3] + '}'; | |
| // console.log(data); | |
| var direccion = dir + '/' + dato[0][0]; | |
| // console.log(direccion); | |
| // hacer llamada put | |
| $.ajax({ | |
| method : "PUT", | |
| url : direccion, | |
| data : data, | |
| dataType : "text" | |
| }).done(function(data, status, jqXHR) { | |
| alert('success'); | |
| }); | |
| }); | |
| }); |