Questions tagged as 'javascript'

3
answers

Get input value whenever changed

I have a <input id="quantity" name="quantity" min="1" max="3" type="number"> element where I store its value in a var qty = $('#quantity').val(); variable by default the value is 1. I would like that whenever I change the...
asked by 16.02.2016 / 20:49
2
answers

Convert to jquery

Good morning, after researching a lot, I "realized" how practical jquery is, but I came across an obstacle. How would the below script look in jquery format? function enableQuantity(prod,quantity) { if(document.getElementById(prod).c...
asked by 17.02.2016 / 12:02
3
answers

How to list jSON separating key and value correctly

I've created this example to illustrate an attempt to list JSON searching for separate key and value: var meuArray = { "1": "Administra\u00e7\u00e3o", "2": "Agronomia", "3": "Arquitetura e Urbanismo", "4": "Artes C\u00...
asked by 26.01.2016 / 02:47
3
answers

What condition can I develop to avoid duplicating values?

How to avoid duplicate numbers in this random generator? var soma = 0 while (soma < 1000) { soma += parseInt(Math.random() * 100) document.write(soma + "<br>") } As you run, it arrives at a certain point that i...
asked by 24.03.2017 / 12:25
2
answers

Value of php in javascript?

The idea is that this is not working when I add the value of the php variable directly in the javascript, for example -3,3462, -60,6790 it works, do you know what it could be? <?php $variavel = "-3,3462, -60,6790"; ?> &l...
asked by 13.04.2017 / 10:41
1
answer

Failed to call function with JavaScript parameter

I have the following function: function show(msg, el){ if(msg.alertType == 0){ resetForm(el); setTimeout(function(){ $('#show-toast').removeClass('toast-show'); $('#show-toast .td.result .msg').rem...
asked by 03.03.2017 / 14:56
1
answer

Change the action of a form according to the condition

I have a form that does an update. But I wanted to put a checkbox type input that when checked, changed the action of my form to delete.     
asked by 09.03.2017 / 03:28
0
answers

AngularJS + RequireJS [Error Injection]

Introduction I'm developing a structure using AngularJS and RequireJS . I'm starting to study RequireJS and I researched a lot about it, but I still have not gotten any clear of it using AngularJS . Github Code Problem [Solved]...
asked by 17.06.2015 / 05:57
0
answers

How to configure the Java HttpClient to accept JavaScript and Cookies?

I need to get my HttpClient return to run a JavaScript and load cookies into it, does anyone know how to configure it so that it can be possible? Thankful     
asked by 16.06.2015 / 22:50
4
answers

Error with the return of a function to catch century of a year [closed]

In a function in JS where the user spends the year as a parameter and the function returns the century of that year, but my function always returns 1. function centuryFromYear(year) { if (year => 1 || year <= 101)return 1 else if...
asked by 05.01.2019 / 14:04