Questions tagged as 'javascript'

3
answers

Input date type how to disable the next 7 days from the current date

In an input of type date, how can I do to disable the next 7 days in relation to the current day in the calendar? I know that with JS I can do a function to disable the days before the current one with the min parameter, but how could...
asked by 20.10.2017 / 16:11
2
answers

How to create a function and call its methods without using new, similar to jQuery $?

The $ (dollar sign) of jQuery is a function , however you can access its methods as if it were an object through the "." . Could someone explain, in what way I could do this in a function func , for example? In a more enlighten...
asked by 28.11.2017 / 12:53
3
answers

Change date="" value of tooltips if they are displayed at resolution lower than 767px?

I'm implementing some tooltips in a contact form I'm developing. It turns out that when loaded at a lower resolution (below 767px), the tooltips is cut off. This is because tooltips has had their direction set by data-mytooltip-direc...
asked by 24.10.2016 / 07:34
3
answers

Function with variable quantity of parameters, what better way to do it?

I would like to do a function without setting the required number of parameters. What ways or alternatives can I use to get this result?     
asked by 19.05.2014 / 15:26
6
answers

Turn result combining function into a dynamic function

I have a function that generates all possible combinations of numbers from 1 to 10. The combinations are 4 numbers, ie each combination has 4 different numbers. Ex: [1,2,3,4], [1,2,3,5], [1,2,3,6] ... [7,8,9,10]; I can specify the range of...
asked by 04.09.2014 / 22:44
3
answers

Best way to apply a pattern to the acronym

I have the following possible returns: AB A1 A The first will always be a letter, the second may or may not occur and may be letter or number. In JavaScript it's like this (Example): if (/^[A-Z][\w]$/.test(value.toUpperCase())) {...
asked by 18.09.2018 / 21:54
3
answers

Execute function for each class you find

I'm creating a picture gallery within thumbnails by automatically setting them where I use the calculation below: if($('.thumb img').width()<$('.thumb img').height()){//portrait $('.thumb img').css({ maxWidth:'100%' }); $('.thu...
asked by 16.12.2013 / 17:45
1
answer

What does 1e + 24 console mean?

I noticed that when I type in the chrome console 1000000000000000000000000 it returns me 1e+24 . And when I type 1000000000000000009901591 it also returns me 1e+24 and 1000000000000000000000000 is different f...
asked by 01.04.2014 / 19:23
4
answers

Remove jquery field mask

I have this code to put mask in the field: (function ($) { $(function () { $("#txtCnpjPesquisa").mask("99.999.999/9999-99"); }); })(jQuery); Now here I need to pass the cnpj($("#txtCnpjPesquisa").val()) field without...
asked by 05.05.2014 / 18:47
3
answers

Problem using paragraphs in JSON file

I'm creating a web application which uses JSON files to save site content. In these files are saved small text fragments containing paragraphs. When I try to separate the paragraph using a \n\ or \n or \r\ or \r , I...
asked by 12.12.2013 / 13:13