Questions tagged as 'javascript'

2
answers

How does the code minifier work?

I'm asking this because I went to minify a JS and it gave me a code that I did not quite understand ... My original code: $('input').each(function(a,b){if(b.value == "U"){$('.variacao-sku').remove()}}); What he gave me: $("input").each...
asked by 24.07.2018 / 13:21
1
answer

How does yield * work in Javascript?

Many times, when I have a question that I'm sure has already been answered, I come here in "Ask a question" and I type the terms that I think are key in the title, to get the related answers. But I did not find any when I typed this one. I sa...
asked by 22.03.2017 / 12:35
4
answers

What is the difference between creating a module normally and creating a module within a function?

I've been looking at some sample projects in AngularJS and have come across several times with the following code: (function () { angular.module('meuModulo', [ 'alguma.dependencia', 'outra.dependencia' ]); })(); Th...
asked by 30.03.2016 / 15:46
1
answer

About fallback for CDN

Some people recommend using the following technique ( fallback ) to load Javascript libraries locally if the CDN is out of the loop: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script>w...
asked by 25.07.2014 / 13:10
1
answer

How to customize a select arrow

I have a price list, it has a select for the person to choose the payment cycle as shown in the image:  beingthatIdidwithCSS:-webkit-appearance:none;background:#E9E9E9url("../imagens/bgs/seta.png") 95.5% 50% no-repeat; As shown in t...
asked by 01.05.2014 / 21:57
1
answer

DIV activating scroll in another DIV even with different sizes

I have two div of the same height, but with different contents. And when I do the scroll in one, I wanted the other to go in the same (or at least close to the same) position. The problem is that their contents do not have the same...
asked by 07.05.2014 / 18:29
2
answers

Multiple declaration of variables in Javascript

It has become quite common to declare variables in multiple lines in JavaScript. Primarily, when they are initialized later: var var1 = null, var2 = null, var3 = 0; The "normal" would look like this: var var1 = null; var var2 = nu...
asked by 15.11.2014 / 05:09
2
answers

How to include a indent when using the tab key in a textarea?

I have a <textarea> that will work as a small source editor. I wanted you to press Tab to include a indentation in the text instead of focusing on the next element, which is the default behavior for the key. I wanted it to be poss...
asked by 15.12.2014 / 16:03
2
answers

Simple comparison between dates

I need a simple comparison between dates in javascript so the end date can not be less than the start date. I found some scripts on the internet and tried to adapt to mine, but as I know practically nothing, it did not work. Follow the script...
asked by 06.05.2014 / 20:36
1
answer

How to retrieve via Ajax query result variables in PHP?

I made a query via Ajax which returned the variables within PHP : // Variaveis $nome = $Fetchi['nome']; $email = $Fetchi['email']; $tipo = $Fetchi['tipo']; $senha = "Digite uma nova senha..."; $ativado = $Fetch...
asked by 03.08.2014 / 14:52