Questions tagged as 'javascript'

2
answers

Get parent div attributes through child elements

I have several structures that follow a unique style: <div data-id="1"> <div> <button>Descobrir é o data-id desta estrutura</button> </div> </div>
asked by 05.08.2015 / 21:22
3
answers

Put two Yes and No buttons in a Javascript message

I need to do just that:    If the user clicks No, system closes the message and keeps the information on the screen. On the screen there is a limpar button and it calls the acaoLimpar() function but without displaying a dial...
asked by 15.01.2016 / 14:06
2
answers

How to remove img tags from a text?

I need to remove all img tags from text in javascript. So the pictures do not come. Note: The text is random. How to do it: Vestibulum varius lectus a ante euismod <img src="teste2.jpg"> cursus. Nam sed semper augue, a laoreet purus....
asked by 28.04.2017 / 16:07
3
answers

How can I make a copy of an array without reference?

I would like to know how to make a copy of an array without the reference. Example of what I'd like to do: var a = [1,2,3,4]; var b = a; a[0] = 3; b[0] = "nao me copie!" console.log(a[0]) //mostrar 3 console.log(b[0]) //mostrar frase nao m...
asked by 25.08.2015 / 08:43
3
answers

How to make timer in JavaScript

I need help to make a timer for a page, and it must be different for each difficulty of a game, for example, for easy mode has 1 min, for intermediate has 4 min, and for difficult 8 minutes .     
asked by 15.05.2016 / 13:16
2
answers

Events JavaScript bubbles

What does a JavaScript Bubble Event mean? I could not understand the meaning and use of Bubbles events. Following the W3schools reference: link Could you please help with this reference?     
asked by 25.04.2017 / 13:56
2
answers

Enable and Disable Save Button

I am developing a Revenue / Expense launch system and this works according to what I initially need.    Processes. Revenue Posting, adds the amount of Revenue to the account table.   Example:   Initial Account Balance = 0.00   Revenue...
asked by 11.10.2016 / 16:55
3
answers

How to check if an item is contained in an array?

What am I doing wrong in this if ? if (angular.uppercase(nome[id]) in ['A', 'E','I', 'O', 'U']) { .... } If I only do this, it works. But I'll have to repeat it to others. if (angular.uppercase(nome[id]) == 'A'){ ..... }...
asked by 25.12.2015 / 20:57
3
answers

What is map / reduce?

Map / Reduce is a very common concept in JavaScript and many other languages. What does it mean and how does it work in practice?     
asked by 05.04.2017 / 02:50
3
answers

REGEX - Uppercase words in the middle of the sentence

Is there a regex / replace to make uppercase words in the middle of the sentence for lower case? (Yes, I could pass everything to Lower) but it has a however in it, the rule should be ignored if the word is after point (.). Example: Us...
asked by 19.01.2018 / 16:30