Questions tagged as 'javascript'

3
answers

Invert the order of a list of jQuery elements

How to invert the order in which jQuery iterates an array of elements? In this case what I would like is to invert the contents of items within the array. For example: <ul> <li>Item 1</li> <li>Item 2</li&...
asked by 11.12.2013 / 20:53
3
answers

Which regular expression can I use to remove double spaces in Javascript or PHP? [duplicate]

Which regular expression can I use to remove excess white space? I mean, leave them with the amount of standard spaces. Example From: $string = 'Estou no Stack Overflow em Português '; To: $string = 'Estou no Stack Overflow...
asked by 21.08.2015 / 18:14
4
answers

I need to block ctrl + v in a text box

I want to create an input type="text" that does not allow anything to be pasted into it. You do not need to have any alert or anything, just do not allow the paste.     
asked by 27.02.2014 / 01:58
4
answers

Identify if all characters are equal [duplicate]

I have the following code that works perfectly. In it I have a string and check if all the characters are equal or not: var numbers = '1111121111', firstNumber = numbers.substr(0,1), numbersEquals = true; for(let i = 1; i <...
asked by 19.12.2016 / 19:56
1
answer

Detect phase change, navigator.online

I use this navigator.onLine to check if the user is logged in, however I need to constantly check and use setInterval for this, is there a more elegant way that leaves this gambiarra back type on('navigator.online') ? To c...
asked by 29.05.2015 / 22:12
1
answer

What is TypedArray? What are the advantages of using them, compared to the traditional Array?

I was reading in MDN about TypedArray and saw that several classes derive from this. Classes that are derived from TypeArray : Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Floa...
asked by 17.08.2018 / 16:30
2
answers

Support for users who do not use Javascript is running out?

Yes, of course it's important, but I see a lot of sites that just do not work if JavaScript is turned off. It's more for the sake of curiosity, but nowadays it's almost mandatory to use JavaScript on a large site, so the habit of "user support t...
asked by 03.04.2015 / 01:39
2
answers

Upload image by selecting it and showing thumbnail without refresh on page

How do I make a code to send an image when I select it during registration? And after sending a thumbnail appears on the form, then the user will continue filling in the rest of the form. Similar to what is done in this link .     
asked by 13.02.2014 / 10:49
2
answers

Record audio and stream live

I need to record audio and stream live, I discovered that with HTML5 and JavaScript / jQuery it is possible and that it has plugins that can help me. I'm using one of them, the MediaStreamRecorder and I'm recording and streaming live to myself...
asked by 01.06.2014 / 06:16
3
answers

Difference between validation and mask

I'm doing form validations. As for the validation, everything happens fine, but how to format the fields according to the data entered? Example: In a date field, bars are added automatically, in a phone field, parentheses and dashes are added...
asked by 19.12.2016 / 17:08