Questions tagged as 'javascript'

2
answers

Javascript What is wrong?

I have written this code and except for the header, nothing else comes out. Where is the / the failures? <!DOCTYPE html> <html lang="es"> <body> <h2>JavaScript document.write & document.getElementById.innerHTML Met...
asked by 06.06.2018 / 19:20
1
answer

Open a modal after a Keypress event?

Hello Programmers I am working on an mvc project in an electronic entry to be more specific, I am trying to validate that if an employee is not authorized to enter an area the system generates a modal with the message of UNAUTHORIZED ACCESS atta...
asked by 23.03.2018 / 20:05
3
answers

Javascript difference of 1 decimal [duplicate]

I have the following function, which takes the total of the invoice, adds the amounts that have been paid, subtracts them and obtains the total that remains to be paid: function PagarTotal(){ var total_a_pagar = $('#total_a_pagar').val()...
asked by 04.04.2018 / 13:52
2
answers

How to fill an array with respect to the values of another javascript array?

I am doing the genetic algorithm of a flock of sheep. It turns out that from this exercise I generated a population that would be an array of objects. Population example, of course for this problem you must generate more objects, but this use...
asked by 09.05.2018 / 22:34
2
answers

Why do I assign a value to an object and return 0?

class Coin{ constructor(){ this.price = 0.00; this.total = 0.00; } } function main(){ const coin= new Coin(); price(coin); ver(coin); } function price(coin){ var cont = 0.00; var tot = 0.00; $.ajax({ url: 'https://ap...
asked by 09.05.2018 / 18:27
2
answers

Events in Javascript from html or from script

I have a question about JavaScript events. What would be the difference between doing this: <script> function mostrarMensaje(){ alert("Hola mensaje desde funcion!"); } </script> <input id="clickeable" type="but...
asked by 11.05.2018 / 06:28
2
answers

Question about prompt () in Js

How could I do: var name = prompt("Ingresa tu nombre"); document.write("Bienvenido " + name ); var question = prompt("¿Te animas a jugar?"); First, the prompt is executed, after the welcome message is displayed in the document...
asked by 25.04.2018 / 06:43
1
answer

Because the if ... else is ignored

In this code I do not understand why the forward if is ignored because although there is an error in the authentication, it always goes to the main page regardless of whether the variable err is true. entrar() { var err=false; firebase.auth(...
asked by 12.03.2018 / 17:40
2
answers

Remove styles from a select in materialize

I have a form which I need when selecting an option of a select it appears in the other select different items when selecting the first select, it works for me but when using materializecss.com as a framework, it does not show it to me, how can...
asked by 02.05.2018 / 19:43
1
answer

Drag of arrays in this game is not going

Can someone tell me what I do so that after each movement, I have a travelLog with the coordinates I passed, and saved in my travelLog array of my object? Obviously I do rover.travelLog and it gives me all the time the current coordinate, severa...
asked by 07.03.2018 / 12:59