Questions tagged as 'javascript'

6
answers

Round to two decimals when necessary

I would like to round to two decimals, only when necessary . Below are examples of inputs and outputs Entry: 10 1.7777777 9.1 Exit: 10 1.78 9.1 How can I do this in JavaScript? Fragment var valor = [ 10, 1.77777777...
asked by 11.02.2017 / 14:26
2
answers

How to pass the content of one textarea, to another from another page using JavaScript or Jquery?

I have a page called form.aspx , which contains a form with the following code: <textarea name="summernote3" id="summernote" runat="server"></textarea> <img id="Img2" alt="Editar en pantalla Completa" src="../imagenes/botones/e...
asked by 08.01.2016 / 18:43
4
answers

Passing GTM 0 to local date

I want to pass a date that is in GTM0 to my local time, according to momentjs it's from this way , but I can not convert the date to my local time. moment.locale('es'); let fecha = '2018-12-07 22:56:48'; let fecha_origin = mom...
asked by 08.12.2018 / 03:32
5
answers

Get great-grandson of a div

How can I get the great-grandchild of a div ? Eye without libraries, only pure JavaScript . In this case, it's not just about the great-grandson, but I really want to locate any son, grandson or great-grandchild. In the following code,...
asked by 04.07.2017 / 02:46
1
answer

Create and repeat Cooldown

I want to make a cooldown that when I reach the end of for example 24h add 1 day and start the countdown again of 24h, if someone could help me I would be very grateful, thanks in advance Here something of what I've done trying: var co...
asked by 08.10.2018 / 15:35
3
answers

Arguments in function (Javascript - ES5)

I have the following code: function leerTexto (nombre, callback) { process.nextTick(function () { var contenido = fs.readFileSync(nombre) callback(content.toString()) }) } Leaving aside what the code does, I would like to know why the...
asked by 05.03.2017 / 22:03
3
answers

Is it necessary to divide responsibilities of a controller in AngularJS?

I am creating an ABM with AngularJS, I have a controller usuario.controller.js that has the responsibility to create, delete and display the list of users. The problem is that every time I load the view create the controller is re-insta...
asked by 18.12.2015 / 02:25
2
answers

Is there any way for the user to write text in JavaScript without pop-ups?

I'm starting in JavaScript, I know you can ask the user to insert any text with the code: prompt("Inserta lo que quieras"); The problem with this is that a pop-up window opens and I was wondering if there was any way to do the same, but tha...
asked by 15.01.2016 / 14:49
5
answers

Transform a given date in yyyy-mm-dd format to string in javaScript?

I capture a date in yyy-mm-dd (2016-06-30) format and I want to give it a more friendly format for the user, I look for the following: 2016-06-30 = 6 de Junio del 2016 2016-06-30 = Junio (Mostrar el mes dada la fecha) 2016-06-30 = Juev...
asked by 15.09.2016 / 17:49
2
answers

Add divs around another div

I have the following: * { font-family: Arial, Helvetica, sans-serif; } .x-y-center { display: flex !important; justify-content: center !important; align-items: center !important; text-align: center !important; } .g...
asked by 07.04.2017 / 18:33