Questions tagged as 'javascript'

2
answers

Remove more than one item from an array

You can remove more than one item from an array at a time. Follow the code: var teste = [6,4,5]; //meu objectivo é remover os itens 4, 5 por ex //removendo o item 4 teste.splice(1, 1) //removendo o item 5 teste.splice(1, 2) As you can...
asked by 12.02.2015 / 18:50
1
answer

Divide SVG circle into 12 parts

I'm using an SVG circle and I want to split it with a line created dynamically in 12 parts. I can only divide into 4 parts, through its radius. I know it is possible through sin and cos . Example jsfiddle: link Source code...
asked by 16.04.2015 / 11:31
4
answers

How to improve this jQuery code?

I'm learning jQuery and I do not always know exactly how to develop the code more cleanly, semantically, I'll end up learning. How could I improve this code? $("#click_apoio").on('click', function( evento ){ evento.preventDefault();...
asked by 05.08.2015 / 15:29
5
answers

Know number of checkboxes selected

How many checkboxes are being selected and make a count. He selected 1, scored 1, selected another +1 mark, took 1 mark -1. I would like to do a count.     
asked by 30.06.2014 / 19:55
3
answers

Why in JavaScript, 7 (a number) is not an instance of Number?

When we do the following test, we return false . console.log(7 instanceof Number); // FALSE However, in the second test, true is returned. var number = new Number('3'); console.log(number instanceof Number) // TRUE In a s...
asked by 20.07.2015 / 16:22
9
answers

How to assign a parameterized function to the click without executing it?

Explanation: I have an application that defaults to a mostraGrupos() event and when it is executed, it finally drops off the element and tries to assign the escondeGrupos() function to the same element. Code: function mostr...
asked by 28.07.2014 / 13:05
2
answers

There is an "else while"

Is there any way for me to do this? While it's one thing to do that, then when is it another to do that? For example: var i = 0; while(i < 5){ //faça isso i++; } else { //faça aquilo } Is it possible to do this somehow?    ...
asked by 15.01.2018 / 12:15
2
answers

JavaScript function does not wait for the end of another to start

Problem My role is not waiting for the other to be finalized so it can continue, for example: Example: function buscando_dados(){ $.post('ajax.php',{},function(dados){ alert(dados); }); } function buscar_dados(){ buscando...
asked by 16.04.2014 / 17:17
2
answers

How to make a "Hello Word!" in this way

Without using the items below: Strings and String-type functions before output Numbers Regular Expressions Functions with the names: "Hello", "World", "HelloWorld" or anything similar to the output method var helloWord = function(){...
asked by 09.09.2015 / 20:42
6
answers

How do I transform an array that is in a string to array in javascript?

I have a string representing an array as follows: var = "['aaaaa', 'bbbbb', 'ccccc', 'ddddd']"; I want to be able to transform this array that is in the string into an Array to perform manipulations. var = ['aaaaa', 'bbbbb', 'ccccc', 'ddd...
asked by 31.03.2017 / 16:27