Questions tagged as 'javascript'

2
answers

Add object in LocalStorage [object Object] [duplicate]

I've added an object in LocalStorage as follows: user: { authenticated: false, email: '', id: '', cpf: '' } localStorage.setItem('userData', this.user) When I'm going to recover, localStorage.get...
asked by 23.10.2018 / 15:39
2
answers

How to check if a checkbox is checked with jquery? [duplicate]

Hello, I'm trying to do an operation on JS if a checkbox is checked, but I'm not getting success. Here is the code: $('#btn-proximo').click(function(e){ if($('#in_acesso').is('checked')){ $('#div_valida :input').ea...
asked by 05.10.2018 / 17:13
2
answers

Count words in Array

How do I count the number of words that appeared within an array. Example: ['thiago','carlos','pereira','thiago'] "thiago" appeared 2 times, "carlos" 1 and "pereira" 1. I want a logic that does this dynamically regardless of the names....
asked by 28.02.2018 / 19:02
5
answers

Event onclick in image

Is there any way to put an onclick event into image? I tried with a button and the call to the function is working, but I wanted to use an image. I tried something like: <a href="#"> <img src="imagens/search.png" onclick="oculta...
asked by 02.02.2018 / 13:17
3
answers

Expand options for a select element when clicking button

Is it possible to force display of the options of a <select> element via javascript? The idea is to simulate a user's click on select .  Imagine that I have select disabled, and clicking a button it is enabled and al...
asked by 09.02.2018 / 17:45
2
answers

Child component, return to parent component REACT

I have the following modal: <Modal dialogClassName="clientes-modal" show={this.state.show} className="modal fade"> <Modal.Header className="bg-new"> <h4 ><i className="fa fa-plus"/> Novo Cliente</h4>...
asked by 24.05.2018 / 15:09
4
answers

Validating Date of birth

Hello, I am trying to validate birthdate less than 15 years using the following rule: 1- If the user enters the date of birth, check if the day, month and year that the user entered, is less than 15 years, if so, the button will be hidden....
asked by 21.09.2015 / 16:31
1
answer

JavaScript window.navigator returning wrong data?

I am studying JavaScript, and I came across something strange, I put this command in the Chrome console alert(navigator.appCodeName); , which returns the browser name, but always returns, "Mozilla" , instead of "Chrome" , I wou...
asked by 09.10.2015 / 18:29
1
answer

Problem with JS code (Uncaught SyntaxError: missing) after argument list)

Well, I have a code from a pop-up chatbox, but it is giving the following error:    Uncaught SyntaxError: missing) after argument list Code: //Variáveis a editar var imagen_chatbox_desplegable = "http://i45.servimg.com/u/f45/17/45/19/7...
asked by 16.09.2015 / 16:26
2
answers

Change variable value in Ajax

The Problem I have the flagExistenciaArquivo variable, and need to be updated if the file exists or not. I call the verificaExistenciaArquivo function inside another function by setting the folder of that file and filename ....
asked by 28.08.2015 / 15:59