Questions tagged as 'javascript'

3
answers

delete tr from a table and keep the order of the IDs

I wanted to know if there is a way to delete a row from a table using jquery where the ids are ordered correlatively keeping the order. This is, for example: <tr id=1> <tr id=2> <tr id=3> If I delete row 2 it should look l...
asked by 18.01.2018 / 15:55
1
answer

Inheritance in JavaScript

Good, we have seen a bit of object-oriented programming in javascript and have sent us to do an exercise to use inheritance. You have to calculate the volume of a cylinder in which we have to use the radius of a circle from a previous exercise....
asked by 17.01.2018 / 15:45
2
answers

Error selecting Checkbox

I have the following code (very simple) if (document.getElementById(id).checked == false) document.getElementById(id).checked = true; And it works perfectly, but it shows the following error As I said before, it works. But I n...
asked by 17.01.2018 / 13:58
2
answers

Collect id from a file with right click

I'm designing a web app, a cloud. When I upload a file to the database of the one ID, I show the file in question by screen. Up here without problems, the problem comes to me when I want to perform X action on that file. I have disabled the righ...
asked by 10.04.2018 / 16:28
2
answers

Problem with sweetalert confirm link

Good morning, I am somewhat confused since I tried to make a confirmation modal before going to a link (basically before deleting an item from the DB, asking if it is safe) using sweetalert2 and I get several errors that I can not / I can sol...
asked by 13.12.2017 / 14:29
1
answer

How to refactor excess of conditions if?

I have the following block of code: data.split('\n').map(l => { if (/^videoW/.exec(l)) { vidConf.videoW = l.split('=')[1] } if (/^videoH/.exec(l)) { vidConf.videoH = l.split('=')[1] } if (/^videoT/.exec(l)) {...
asked by 21.12.2017 / 20:13
1
answer

Confirm button "delete" in CRUD

Good afternoon, I have a code that works with an id="confirm" so you have to confirm before deleting a record from a CRUD using datatables. The problem is that since it is a crud, it can not work with ID's since there would be several elem...
asked by 20.12.2017 / 20:31
2
answers

Question about if else statements

Simple question of a newbie, I do not understand why the numerical 0 gives me a pair in this case, I want it to be 0 , '' , isNaN me% 'Por favor, introduce un valor numérico válido' : let numeroUsuario, modulo;...
asked by 13.12.2017 / 16:48
6
answers

set as value 0 if the input is empty

I'm doing a calculator in which you fill in the fields and do the operations, but how do I do it so that, if the input has no value, javascript interprets it as 0? var button = document.getElementsByTagName("input")[2]; var input1 = doc...
asked by 14.08.2018 / 21:56
2
answers

hover with jQuery when you click on div

I'm working with HTML5, CSS, Bootrap and JQuery. The problem is not to change the color to the div, what I can not do is to execute the action until you click on one of the divs. When you click on the payment button for extra hours, take the col...
asked by 09.08.2018 / 23:37