Questions tagged as 'javascript'

3
answers

How to check if variables are filled with strings? and do not show them when empty

In the final result object, I could have multiple items, sometimes these are not registered, so I'd like to avoid showing on-screen empty tags. Example: mostrador.innerHTML = filtrados.map( (obj) => ' <h4>${obj.cidade}...
asked by 11.07.2018 / 20:14
2
answers

document.getElementById () .value is not working with window.open ()

I want to generate a clean print page with some information only. For this I am using the following code (well summarized) in javascript: function myFunction() { var myWindow = window.open(" ", "_self"); var str1 = "Janela de Impress...
asked by 26.11.2018 / 19:58
2
answers

Can anyone identify the error in this code? [closed]

Days ago I asked a question about how to add a class to an element when clicking the button , the answers were satisfactory (I did using JQuery as me sessionStorage.removeItem('Contar'); function AddClass(id){ //pega o valor do bot...
asked by 05.02.2014 / 15:47
3
answers

Make one input receive a value less than another

<input type="number" name="total" value="25" required> <input type="number" name="valor-em-dinheiro" class="form-control text-right" required> I have two input where the first one receives the value of 25, wanted to know...
asked by 07.12.2018 / 01:12
3
answers

Doubt with switch in JavaScript

I'm doing a JavaScript course, and I need to do an exercise with the statement " Write a function that given a total of years of study returns how experienced the user is." My code: function experiencia(anos) { switch (anos) { c...
asked by 21.07.2018 / 13:29
2
answers

Date format javascript

I was looking at the ISO8601 that talks about the format of string passed as argument to object date . On this site, the date returned is from yesterday. I'mpassingthe'2017-08-03'valuetothedateobjectanditreturnsmethedatefromyesterday,s...
asked by 03.08.2017 / 15:04
1
answer

Download PDF Files in ReactJs

I have a small problem downloading files into PDF I have an API that returns a array of bytes with type : "application/pdf" , if I call directly in the browser my route. Ex: localhost/api/download/pdf/{id} PDF download...
asked by 31.05.2017 / 20:57
1
answer

Assigning value to an input - jQuery [duplicate]

I have two input type="hidden" of which I make an Ajax request to an external file in order to assign values to it. The request is returning the value correctly, everything is right in it, but these values are not being assigned to i...
asked by 13.09.2017 / 21:46
3
answers

Chart JS - hide caption

Hello I'm using Chart.js in a project, however I need to hide the caption that appears above the chart. Does anyone who has worked with this chart know how to hide this part? Follow the link of the chart I'm using: link Here is...
asked by 01.07.2016 / 15:27
2
answers

How to convert a string to object in JavaScript?

I have this code: <html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta name="robots" content="noindex, nofollow"> <meta name="googlebot" content="noindex, nofollow">...
asked by 03.08.2017 / 15:11