Questions tagged as 'javascript'

2
answers

Verify decimals [closed]

function c(n) { var v; if (n % 1 !== 0) v = parseFloat(n); // Verifico si el numero es decimal y uso parseFloat else v = parseInt(n); // Verifico si el numero es entero y uso parseInt return v; // Retorno el numero } conso...
asked by 30.08.2017 / 16:49
4
answers

How to remove all matches?

var b = "Holaa Holaa Holaa Holaa "; console.log(b); How can I remove all Holaa matches except the first? Exactly I mean the whole chain itself, taking into account this example: String.prototype.repetir = function(v) {...
asked by 04.07.2017 / 09:46
1
answer

Form with HTML that stores the data in JavaScript variables [closed]

I need to create an HTML form that at the time of pressing submit, save all the data entered in different variables, I need them to be saved in those variables to be output later by a .pdf document which is already programmed. Maybe the quest...
asked by 25.07.2017 / 18:15
1
answer

I do not get the desired result in Bootstrap

I'm starting with Bootstrap creating a page header, based on the page of this link link and a JavaDevOne tutorial on yt. My problem is that the result I get is not the one that is consistent with the example of bootstrap or the tutorial. I...
asked by 28.09.2017 / 15:09
1
answer

Uncaught SyntaxError: Unexpected token using $ http.get ()

I am trying to get a list through a url using the GET method, but it generates a very confusing error, since it is the first time I see it. Uncaught SyntaxError: Unexpected token . He tells me that I have the error in the next line...
asked by 29.10.2017 / 22:03
2
answers

vee validate does not work

I'm doing tests with vuejs and the library VeeValidate which is to validate fields in a form. I have an example to validate an email field like the following: <form> <div class="form-group" :class="{'has-error': errors.has('e...
asked by 16.04.2017 / 18:50
1
answer

Javascript, how to show only two decimals

I want to show two decimals when calculating, since for example I enter the amount 100 and when calculating in the other fields many decimals appear. I already try to do it with .toFixed(2) and I can not make it work. Illustrati...
asked by 15.03.2016 / 06:12
1
answer

why when I put a function as an array value, it returns function syntax and not its value?

var A = [ 'dog', 'cat', function () { return 2 * 2 } ] ; document.body.innerHTML = A[2] Return this: function () {return 2 * 2} Obviously I want you to return 4 , not the syntax of a function Or is it that you can not put a function in an...
asked by 02.01.2019 / 16:58
3
answers

Alert success form

What happens is the following I have a registration form and what I want is that what is recorded comes out a sweetAlert . The problem is that pressing the button leaves the alert so the form is not validated. I would like to know how I do...
asked by 07.04.2016 / 13:49
2
answers

Deactivate controls using JavaScript if there are elements in a TextBox

I have this TextBox in which when I update the page you can see div as windows with a "MouseOver" event, what I try to do is the following: When I refresh "N" times the page that in the first instance these div do not g...
asked by 08.04.2016 / 20:32