Questions tagged as 'javascript'

1
answer

Is it okay to instantiate from "class" directly?

I understand that in javascript everything is an object. In making these examples I realized that the two ways of declaring the object that I need returns the same, is it right to do this?     
asked by 09.09.2018 / 18:51
2
answers

Show complete an array

I have a program that I return an arrays with more than 100 number, the question is that in console (node) I get the following: [1, ,2 ,3 ,4 ,5 ,6 ,7 ... ,20 ,21 ,22 ... 88 more items ] How do I get my items to go side by side? Am I clea...
asked by 09.09.2018 / 20:47
1
answer

Confirm before deleting a record?

What I'm looking for is to confirm before doing the deletion. This is my form.    removeClient.php <!DOCTYPE html> <html> <head> <meta http-equiv="Content-type" content="text/html"; charset="utf-8"> <...
asked by 15.05.2018 / 13:40
1
answer

Truncated JS does not take 0 to the right

How can I truncate a decimal number with zeros to the right, since it always truncates to the natural number, that is, if there is a 0 it does not take it? function myRound(num, dec) { var exp = Math.pow(10, dec || 2); // 2 decimales...
asked by 16.05.2018 / 17:08
1
answer

Return the central character if the number of characters is odd and if it is even to return the 2 central characters

What must return is to execute is the central character if the number of characters is odd and if it is even to return the 2 central characters, what should return is "is". (function getMiddle(s) { var name = s; var name2 = s.length; if(na...
asked by 01.05.2018 / 21:08
1
answer

How to get a value from an Input and pass it to php without reloading form

Good I have a problem, I would like to try to obtain a value of an input, which is entered, to later evaluate it in php. But I do not want to reload the Form. I would like to evaluate on the same page once the data is entered. I know a bit of ja...
asked by 03.05.2018 / 14:08
2
answers

Add a few minutes to the one currently obtained

Something I must be doing wrong because when I add 5 minutes to the time I just got a result that is not in minutes comes out. I have the following function in javascript and jquery that I am running with tampermonkey :...
asked by 08.08.2018 / 12:48
3
answers

Foreach in jquery

In the result of the ajax query, I receive a json, to this I need to list it in a table, apply the following, but it does not work for me. Someone to give me a hand, please. $.ajax({ url:rutaOculta+"ajax/ajax.carrito.php", method:...
asked by 17.05.2018 / 00:06
2
answers

Consultation in ajax

$(document).ready(function () { var click = $('.click'); click.on('click', function () { var id = $(this).data('id'); usuario = '<?php $idMesero;?>'; for (var i = 1; i <= 14; i++) {...
asked by 20.05.2018 / 22:57
1
answer

Add an INPUT to it (as a serial key)

I want to format an input, I do not know what to do: '( I want the format to come out this way    00-00-0000-1234567 But it comes out like this    00-00-1234567-0000 <form id="form" method="post" action=""> <input...
asked by 29.06.2018 / 22:24