Questions tagged as 'javascript'

3
answers

Simple sum returning NaN

I'm trying to make a simple sum in a routine: var sum1 = $('input[name=hdValor01]').val(); // 40 var sum2 = $('input[name=hdValor02]').val(); // var sum3 = $('input[name=hdValor03]').val(); // 30 console.log( parseInt(sum1) + parseInt(sum...
asked by 04.10.2017 / 20:56
3
answers

Transform String into an Array - Javascript

With this return I'm getting the following string : return $data.requestSuprimentos.value; String [[1, X340H22G, 30000, 3], [2, 64418XL, 32000, 1], [3, X644X11L, 32000, 1], [4, 64018HL, 21000, 1], [5, 12A7610, 32000, 1], [...
asked by 16.11.2017 / 18:57
3
answers

Is there any way to write a function on the screen other than by onclick? [closed]

Hello, the only way I can call a javascript function in html is by onclick, but my html is not a button to click, I would like to know if there is another way to display a function when it is called. ex: onload -> para quando a tela carregar...
asked by 13.10.2017 / 20:25
3
answers

Formatting problem when injecting date into attribute datetime

I need to assign the current date in a datetime field of a paragraph, for that I have implemented: ... var newDate = new Date(), date = newDate.getFullYear() + "-" + (newDate.getMonth() + 1) + "-" + newDate.getDate() + " " + newDate.ge...
asked by 23.02.2015 / 15:31
2
answers

Show / hide each element within a class with toggle (jquery)

I have a class .menu-departamento and inside it I have a h3 and a ul li , in which I'm putting a toogle effect. In the code below when I click on a h3 it displays all ul and you want it to display only...
asked by 19.01.2015 / 14:00
1
answer

How to make an animation by replacing images

There is a game browser on the internet that has a feature that I found interesting and would like to know how to do it. Asyoucanseeinthefigure,therearesomebuildings,someobjectsandsomepeople!Lookinglikethislookslikeareadyimage,howeveranyitemi...
asked by 16.02.2015 / 02:23
3
answers

How to change an item in a json

I have a JSON Array something like this: [{ id: 1, total: 50.00 }, { id: 2, total: 70.00 }] I would like to know how to add / change an item to a id only. Like it was in SQL. For example, in the case I wanted to change the...
asked by 16.02.2015 / 18:18
1
answer

How to use multiple conditions within an if

I have tried in many ways, grouping with () of all the ways that I imagined, creating a variable and calling it in the condition etc, but I can find where I am wrong. $(function() { $('#id1').change(function(){ if (($(this).v...
asked by 19.07.2015 / 07:46
1
answer

Implement Lambda Expression TRUE, FALSE, AND, OR, and NOT with Javascript

I was reading about lambda > in this article and there were some examples of functional programming implementing TRUE, FALSE, NOT, AND and OR with Ruby: T = lambda { |a,b| a } F = lambda { |a,b| b } display = lambda { |boolean| boolean['v...
asked by 12.07.2015 / 09:34
2
answers

How to omit a specific ng-options item?

I have this code snippet below to load a comboBox with the 'name' of all values and is working correctly. <select ng-model="information" ng-options="value.id as value.name for value in information"> </select> But I ne...
asked by 06.08.2015 / 02:29