Questions tagged as 'javascript'

1
answer

Problem when extracting data

I have Menu (food) within those menus I have submenus (first, second, etc) and within submenus I have dishes. The submenus I generate them perfect and as soon as the dishes always fill them with the last dishes of the last submenu id with whi...
asked by 16.05.2018 / 13:54
2
answers

Subtract two Arrays in javascript

How about the idea would be the subtraction of two dates in javascript to then add it within the function. I show them what I am doing and so they can help me. var newYear = new Array(12, 5, 2018); var jhon = { name: "Jhon", l...
asked by 13.05.2018 / 01:16
1
answer

New or previous value in script according to input

I need that when "nuevo_saldo" equals zero: the value of "restan" is also zero. But ... if it were not like that, keep its initial value . EDITED: Thanks to a timely response (@alanfcm) an advance was achieved in this problem...
asked by 17.05.2018 / 15:28
1
answer

How to get selected item with click (id and position)

I'm trying to do some things with DOM and I have a problem that, a priori, I find no solution. Given an HTML code, I would like to obtain the type of element (div, button, table ...) and its position. Obtaining the type of element with the...
asked by 13.05.2018 / 14:32
1
answer

How can I implement the has-error class as it appears in the image by jquery

$(document).ready(function() { $("button").on("click", function() { //Variables para evaluar el ingreso de datos var username = ($('#username').val()); var password = ($('#password').val());...
asked by 13.05.2018 / 08:16
1
answer

How to make reference in package.json to another module of my project?

Hello my application created with node.js I have several modules: the database, the Api, customer service, etc ... Well, in some I have to refer to another in the package.json file but I do not know if I'm doing it right, because when I start li...
asked by 23.05.2018 / 13:44
1
answer

Store and compare attribute value of an object in javascript

I have an object with some attributes and would like to store the value of one (the attribute is "state" and has value "closed") in a variable to compare its value by an "if" statement. What I'm looking for is doing something depending on the va...
asked by 10.05.2018 / 10:17
1
answer

Move to the form a ListObject from JS to Server

I have a form on a web page to which I collect some values from JS and add them to an object. All those objects I put them into an array and add it to a hidden input I have on the page: document.editRouteForm.busStops.value = JSON.stringify(ge...
asked by 10.05.2018 / 07:20
1
answer

Receive and display an array of C # in JavaScript

I have an array of C # that I need to show when I enter a certain page. I am making a request with AJAX to receive this data. $.post({ url: '/Home/MostrarArray', success: function (datas) { console.log(datas);...
asked by 09.05.2018 / 09:12
1
answer

asp.net mvc doubt with the conditional if with keys and without keys "{...}"

I have a question about what moments or parts of the code you can use a conditional if or another that can be written without the keys { ... } . For what I read this will depend on the amount of code that contains that conditiona...
asked by 09.05.2018 / 15:13