I'm learning to write UserScripts (for TamperMonkey ) and pretty much all the examples I see make use of a with_jquery function:
function with_jquery(f) {
if (!jQuery)
return;
var script = document.createElement("script");...
I have a div that is used to display alerts to the user:
<div id="page-alerts" style="margin:25px 0;"></div>
Problem
Example in JSFiddle
For formatting issues, it contains margins at the top and bottom, causing...
Sometimes I see using success , sometimes I see .done , to handle the response obtained in the request.
Which one should I use?
Is there a difference between the two? What?
Same thing for .error and .fail .
I...
I remembered that there is a function in jQuery called filter . I already know find , but I want to know if there is any difference between them or if they are the same thing.
Then after a true pilgrimage that yielded some 10 questions, I discovered that the masks I was using do not work correctly on mobile devices.
The main ones are (were?):
MaskMoney
inputMask
What happens is that on the mobile de...
In ATMs and internet banking websites there are numeric fields that when you type they are filled from right to left, increasing the number as you type, for example:
+-----+--------------+
|tecla|valor do campo|
+-----+--------------+
| |...
I'm working with a CPF validation in my controller , but I need to validate when the client exits the input of the CPF and then return a message advising when the CPF is incorrect, alert or something similar.
I tried to do somethin...
Note that there is a difference between updating or applying a data attribute using the jQuery method .attr() and the method .data() .
The examples below can be seen in this JSFiddle .
Apply value to non-existent...
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 ?...
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...