Questions tagged as 'javascript'

1
answer

Comparison of strings (that match the hours) in javascript is reliable? How it works?

It is well known that in terms of time, that 07:30 is less than 08:30 - speaking in hours. In javascript, if we make this comparison, everything goes as expected above '07:30' < '08:00' // true '08:30' > '09:00' // fals...
asked by 24.08.2015 / 19:14
2
answers

Add to favorites

I have a "add to favorites" code <script type="text/javascript"> $(function() { $('#bookmarkme').click(function() { if (window.sidebar && window.sidebar.addPanel) { // Mozilla Firefox Bookmark...
asked by 02.09.2015 / 00:36
2
answers

Sorting by date how long they are of type string

I'm developing an angularJS application which receives the following object from an API: pessoas = [ { nome: 'Lucas', data: '2010-Fev-04'}, { nome: 'Felipe', data: '1994-Dec-10'}, { nome: 'Ana', data: '1994-Jun-21'}, { nome: 'C...
asked by 13.07.2018 / 21:21
1
answer

How to make a function with infinite number of parameters?

How do I make a JavaScript function that can receive an infinite amount of parameters? When I refer to infinite , I am aware that there is a limit, but I want to do a function where the person can pass as many parameters as he wants: one, tw...
asked by 25.07.2018 / 14:32
2
answers

Identify whether the mouse scroll is scrolling up or down [closed]

Is it possible with Javascript to know if the scroll of the mouse is scrolling up or down?     
asked by 16.08.2018 / 14:09
2
answers

Handling Ajax data

Personal oops. I have a page that receives JSON data from an Ajax request from time to time in this format: { "status":"success", "total":4, "0":{ "id_user":"11", "posicao":0, "nick":"Usuario", "premium":"0...
asked by 19.08.2018 / 15:09
2
answers

How to get the last day of a month with MomentJS?

I'm using MomentJS and I need to get the first and last day of the current month. Currently, to get the first day of the month I'm doing this: var data_inicial = moment().format('01/MM/YYYY') So far so good, since every month sta...
asked by 19.09.2018 / 15:03
2
answers

Get content from text fields via ID using JavaScript

I have a checkbox that at the time I select and search for the value in the type="text" field, one of the fields is working perfectly plus the second field does not work. function pega(){ var opcao = document.getElementById("opc...
asked by 01.12.2015 / 21:51
2
answers

Set file name in the dialog of an input file

Good morning, I wonder if there is any way to set a default name in the input type="file"... dialog. And also if there is how to define the way in which this dialog will open. Eg "/ Downloads /", (I would always like to open that path)....
asked by 17.11.2015 / 12:02
2
answers

How to click and descend a hidden part?

I know the question is confusing, but it's the following, I made a jQuery code through codeacademy (jQuery Functions and Selectors 11.Click and Pull), and there teaches you to do an algorithm that I found very cool, but it only works there, in m...
asked by 19.11.2015 / 02:15