Questions tagged as 'javascript'

4
answers

change class of the clicked element

So guys I have a list: <ul class="nav nav-tabs" id="myTab"> <li class="active"><a href="#novas"><span class="badge badge-info"><?php echo $qtd_novas ?></span> Novas Mensagens</a></li> <l...
asked by 10.04.2015 / 21:43
2
answers

How do I disable the text selection on the right-click?

I do not want to disable text selection, nor do I want to disable the right click. I want to ONLY disable text selection with the right-click (but the menu should still appear when right clicking and select text by double-clicking or clicking +...
asked by 06.04.2015 / 20:36
2
answers

Use multiple names with distinct functions in one variable

See these variable declarations: var level = 0; var atual_sequence = 0; Could I put them together like this?: var level, atual_sequence = 0; Would one affect the functionality of the other?     
asked by 06.04.2015 / 20:43
1
answer

Making a Get using Axios (Vue.js)

I'm trying to pull a list of names from a json ( link ) using the axes however I do not understand why I get the error TypeError: Can not set property 'pokemons' of undefined Since my console.log is returning the list correctly, it follo...
asked by 09.08.2017 / 03:54
2
answers

Declare a variable receiving element of a vector within a for is a good practice or is it unnecessary?

// code 1 var pacientes = document.querySelectorAll(".paciente"); for(var i = 0; i < pacientes.length; i++){ var paciente = pacientes[i]; //linha desnecessária paciente.classList.remove("invisivel"); } // Code 2 var pacientes...
asked by 09.08.2017 / 21:11
4
answers

Select input with a given class within a form

I have a form and inside this form I am adding a certain input dynamically via jquery using a button, these inputs go to array in a C # controller.   CurrentlyI'mdoingthis:for(varj=0;j<numeroDePiscinas;j++){formdata.appen...
asked by 06.06.2017 / 15:09
1
answer

calculate percentage of iterated items in a loop

How to get the percentage of total items in an array that were processed in a loop? Example: // array fictício (238 itens) var arr = ["AF","AL","DZ","AS","AD","AO","AQ","AG","AR","AM","AW","AU","AT","AZ","BS","BH","BD","BB","BY","BE","BZ","...
asked by 18.06.2017 / 05:38
2
answers

search for value in object json and return position in array

Is there any way to search for the surname in the object and return the position in the main array? Eg: Searching SOUZA return index position in the array and retrieve the same data for display. function filtrar(){ var quadro=[...
asked by 04.09.2018 / 21:46
1
answer

Confirm password PHP, Javascript, HTML

I wanted to do the password verification, if the passwords are different then an alert with something like "Passwords do not match" appears, if it did, it would pass through. But the way I'm doing it appears a message from the $ message "The pa...
asked by 05.10.2018 / 19:35
1
answer

What are the differences between Object.freeze () and Object.seal ()?

I know that Object.freeze() and Object.seal() are used to "freeze" an object. Soon, knowing this, if you run the example below you will see that the two objects were frozen and soon I could not assign values to them. let obje...
asked by 23.10.2018 / 22:22