Questions tagged as 'javascript'

6
answers

How to disable the scrolling of a web page?

I've been trying to disable scrolling a page. All I have found are solutions of the type: #container{ overflow: hidden; } But this just hides the scroll bar. How would I disable scrolling even with it being displayed on the screen ?...
asked by 20.02.2014 / 00:47
4
answers

How to round to the nearest ten?

How can I round off a number to the nearest ten in JavaScript? For example: The user types 11, there it would round to 20; the user types 11.5, would round to 20; and so on.     
asked by 05.01.2014 / 00:36
2
answers

What are the operators | &?

I was analyzing a code and found some operators I do not know about: | , & , >> and% with%. What is the functionality of these operators? bits = h1 << 18 | h2 << 12 | h3 << 6 | h4; o1 = bits &g...
asked by 04.03.2015 / 14:28
2
answers

What are AMD and CommonJS?

Recently I've heard a lot about Asynchronous Module Definition (AMD) and CommonJS. They look like two trendy terms. I read a few things about it, but I'm still confused. AMD and CommonJS are libraries or specifications? Who can explain...
asked by 25.07.2014 / 16:52
5
answers

JS Mask for Validation of Hours

I'm using jQuery Masked Input in a project. I made a mask like this: <script> $(document).ready(function () { $("#QuantidadeHoras").mask("99:99"); }); </script> The <input> only lets me fill in the...
asked by 25.06.2015 / 02:36
3
answers

When using success: function () and .done (function ()) in asynchronous requests?

In a simple way, I can write an asynchronous request like: $.ajax({ url: url, dataType: 'json', type: 'GET', success: function (_user){ alert (_user) } }); that alerts me to the _user return. Also, I write...
asked by 27.07.2016 / 19:39
3
answers

Function to add more hours or days to a date

I do not know much about the new Date() function and I wanted a way to add days / hours to a date. Example: I have: var Time = "14/03/2014 23:54"; I want to add 2 hours to Time , so it adds 2 hours and adds 1 a day. var Time = "15...
asked by 14.03.2014 / 06:01
3
answers

What are "Magic Numbers" in JavaScript?

My IDE reported that I'm using magic numbers in my code, in the f = 12 stretch. I'd like to know more about what "magic numbers" are. I need to have a variable of value 12, but the IDE has said something about constants in JavaScript...
asked by 15.06.2016 / 15:47
5
answers

Event is not tied to element

I have an event in jQuery (version 1.5) as follows: $('#refresh_abertos').click(function(){ // aqui o código irrelevante nesta pergunta }); It turns out that my #refresh_abertos element is only loaded later via ajax ,...
asked by 21.01.2014 / 14:25
6
answers

How to make a stopwatch continue counting after closing the page?

I need to create a timer that is started through a play , but I wanted a solution, other than just SESSION , to let even if the client closes the window or drops his internet, that is, it is not dependent on cache or front ....
asked by 08.05.2015 / 20:30