Questions tagged as 'javascript'

3
answers

How to do a filter through attribute on an object / array

I think it's a simple question but I'm not finding a solution to my problem. Example: Object: {projectId:"1" name:"Projeto A" image:"imagem.jpg"} {projectId:"2" name:"Projeto B" image:"imagem.jpg"} {projectId:"3" name:"Projeto C" image:"...
asked by 24.10.2017 / 13:45
2
answers

Put Javascript function inside the onclick

So it's a bit silly doubt but I need it a lot ... I have a Javascript function inside a buttom in this example it calls the loadDoc () function. but I'd like to put the function directly inside the onclick. <!DOCTYPE html> <html> &...
asked by 09.12.2016 / 00:16
3
answers

InvalidCharacterError

I have a inputParams variable with the string "Teste StackOverflow€" But I need to do btoa() of this variable and the error is occurring:    Failed to execute 'btoa' on 'Window': The string to be encoded   contains cha...
asked by 20.12.2017 / 18:08
3
answers

CSS Change Time with JavaScript

I have a function: function togglePopup1() { document.getElementById('desktop-card').style.width = '480px'; } The code is for width of the page to increase with a click. But how do I make this change happen, for example, in 2...
asked by 16.11.2018 / 08:28
3
answers

How do I get the logo to disappear when I scroll the page?

I am creating a menu with version 4.1.3 of Bootstrap and would like to know how can I make to scroll the page to disappear? In this case, only the menu should stay.    Note: When returning to initial position the logo should reappear. The...
asked by 21.09.2018 / 15:56
4
answers

In a sentence, how to know which word with fewer characters?

In one sentence, how do you know which word has fewer characters? What I did was to transform the string into an array, but I was only able to return the smallest when it comes to an array of numbers, using Array.min But is there any method or b...
asked by 24.08.2018 / 22:38
3
answers

How to use forEach in associative JavaScript array

I'm seeing here that the length of an associative array in JS gets zeroed. How do I access those values then? Example: let myArray = []; myArray['zero'] = 0; myArray['um'] = 1; myArray['dois'] = 2; console.log(myArray.length);...
asked by 29.11.2018 / 14:58
3
answers

How to get the day with two houses in JS [duplicate]

I have a form of type date, and I need to generate the 'min' and 'max' it according to the current date. I made a function that calculates that date and arrow it in the form. The problem is that the value of the day is coming with 1 home and i...
asked by 03.12.2018 / 17:19
2
answers

How to separate numbers from three to three, backwards in JavaScript, without regular expression?

I already know how to separate the numbers of three in three, backwards, with regular expression in JavaScript . But I would like to know if there is a simpler solution in JavaScript, and without the use of regular expression. For example...
asked by 06.02.2017 / 12:05
2
answers

Difference between 'click', 'bind', 'live', 'delegate', 'trigger' and 'on' functions?

I gave a searched but there is not a comparison list between the functions below: $().click(fn) $().bind('click', fn) $().live('click', fn) $().delegate(selector, 'click', fn) $().trigger('click') $().on('click', selector, fn); How do all...
asked by 28.09.2018 / 20:37