Questions tagged as 'javascript'

2
answers

Calculate the average of a result group

I have a results group and I need to calculate their average, how do I do this in jQuery? The elements are already in variables and separated by classes, for example: deztotal = parseInt($this.find( ".dezmembros" ).html()); My HTML: &l...
asked by 19.07.2014 / 02:06
2
answers

JavaScript reaching number 100

I have a problem in a sum in JavaScript, example 188/100 = 1.88 * 100 = 188, but I do not want it to reach 188, I want the number to always reach number 100.    188/100 * 100 = 100 Personally I've got it simple! i = 50; 100/i*i;     
asked by 12.06.2014 / 19:51
3
answers

Comparing 2 password fields if they are equal

I have a password field and confirm password, I want to check if both are the same. NOTE: There is an autocomplete OFF for the email field $(document).ready(function () { $('#txtEmail').attr('autocomplete','off'); if( $('#txtSenha'...
asked by 01.12.2014 / 13:04
4
answers

Call javascript function only once

Assuming I have a button that when clicked calls a javascript function. I wish that if this button were clicked several times I would only call this function once. Can you do that? COMPLEMENT My question was incomplete. In case I need to do t...
asked by 07.12.2017 / 16:30
2
answers

Error while using replace

I'm using the replace, but when I pass the number 1 or 12 to it the error. For example: $(this).data('qtde').replace(/\./g, "") Passing the value 1,223,44 works, when step 1 gives the following error:    Uncaught TypeError: $ (...).   HT...
asked by 08.02.2018 / 19:58
2
answers

Jquery removes all the less selected divs and those from the other menu

This code removes all the less selected divs, but also those from the motherboard menu what I was trying to do was make the below ones independent of the above ones. I'm sorry for showing the code like this but you can not put it in the editor b...
asked by 20.02.2018 / 16:32
2
answers

What is the difference between map () and lenght ()?

I was studying and this code appeared: var materials = [ 'Hydrogen', 'Helium', 'Lithium', 'Beryllium' ]; console.log(materials.map(material => material.length)); From what I understand, it scans the array and ret...
asked by 20.01.2018 / 17:21
1
answer

How to get the last tweet?

I need to implement a function in my project to get the last tweet, however all unsuccessful attempts, could someone give me a function to display the last tweet?     
asked by 12.02.2014 / 16:12
2
answers

Leaving the foreach JQery

I'm having difficulty getting out of a foreach when the internal if condition is met, I followed the recommendations in the official JQuery documentation that says to give a return false but it still does not work, follow the code used:...
asked by 17.12.2018 / 13:50
3
answers

Map two arrays and delete the item not found

I have an api on node and I have the following situation: I am the master user and create a usuário A for any employee. This usuário A has the permissions User Permissions A [criar_usuario,editar_usuario,receber_contas,...
asked by 07.11.2018 / 17:03