Questions tagged as 'javascript'

2
answers

Return data from a php server using AJAX

Greetings, I am doing a simple test, it is about sending a data through AJAX to PHP so that I can return a data, but I do not know why it does not return any data. The JavaScript code is as follows: $(document).ready(function(){ $("#l...
asked by 18.09.2017 / 23:13
1
answer

How to load and view a local image

How can I show an image in img by selecting the file with input type file ? <img id="img1" src="" height="100px" width="100px" border="solid 1px"> <input id="inputFile1" type="file"> <script>...
asked by 03.01.2017 / 18:41
2
answers

How to get a json's length

I have a problem trying to traverse a json to get its length (length). This is my code: var parametros = { yMin: "0", yMax: "300", ySteps: "5", yLabel: "users", xMin: "1", xMax: "12",...
asked by 16.12.2016 / 05:18
1
answer

Regex javascript password

Good I have this pattern created /^(?=.*[a-zñ])(?=.*[A-ZÑ])(?=.*[áéíóúÁÉIÓÚ])(?=.*\d){2,4}(?=.*[\$\/\.])[a-zA-ZáéíóúÁÉÍÓÚñÑ\$\/\.\d]{7,15}(?=.*\d$)/; And I must control this: size 8,16, alphabetic characters 2 minimum, with a capital letter...
asked by 13.02.2018 / 18:09
1
answer

Reload the same URL with a different hash (fragment)

In response to an AJAX call: $.ajax({ type: "POST", dataType: 'json', data: { 'descripcion': descripcion }, url: "<?php echo site_url();?>"+"admin", succ...
asked by 24.01.2018 / 14:17
1
answer

Validate a JSON and print it formatted

Suppose I copy a string in a textarea, for example: var str = "{ hello: 'world', places: ['Africa', 'America', 'Asia', 'Australia'] }"; So with JSON.parse(str) I parsed the string in JSON format, but I would like to show the result i...
asked by 24.01.2018 / 11:58
1
answer

Swap items from one list to another

I have an example of these lists: <h2> Lista 1 </h2> <ul class="lista1" id="lista1"> <li>Item1</li> <li>Item2</li> <li>Item3</li> <li>Item4</li&g...
asked by 31.08.2017 / 17:06
2
answers

Keep the data when going from one select to another

I have the following situation, I want to pass data from select to another but keep it in the source. I leave the code to see if you can help me. Example: have the value 10203 T-03 T-Shirt at both the origin and the destination....
asked by 08.08.2017 / 19:20
2
answers

Reading files with JavaScript

I want my code to use the data provided by a file that is in the same root, I know it is done with the FileReader () constructor but I am learning to program and I do not understand how it should work. Example: add two numbers provided by the...
asked by 31.08.2018 / 21:48
1
answer

Define value min and max of newly created input in javascript

I create an input in the following way: var monto_inp = document.createElement("input"); monto_inp.name = "monto"; monto_inp.placeholder = "Monto"; monto_inp.classList.add('detalle_pago'); monto_inp.classList.add('monto'); I would like to a...
asked by 01.09.2018 / 11:05