Questions tagged as 'javascript'

1
answer

Update a div with ajax jquery

Hello! I have this code, yes, I make many errors in the code, I'm new using AJAX and Javascript . var turno_actual = 0; function desplegarAlerta() { $(document).ready(function() { var refreshId = setInterval(function() { $('#tu...
asked by 21.08.2018 / 15:06
2
answers

Variable and Loop in JavaScript

I'm trying to understand the basics to have solid foundations. At the moment I'm doing an exercise to recover some fictitious tweets. I am making an effort to understand well the reason of all the development of the loop and I have something...
asked by 29.11.2018 / 03:09
3
answers

Differentiate types of HTML elements in JavaScript or jQuery

I have a series of labels in my view JSP . Each label shows a unit of measure and if you want to edit it, it is replaced via javascript with a input via button. NOTE: both the labels and the input are elements wit...
asked by 03.12.2015 / 11:32
3
answers

delete an attribute of an object more optimally

I have an empty object defined (associative array) obj = {} If I try to consult some parameter this will return undefined to me because it is empty. >> console.log(obj.id) undefined now I assign a value to id >> obj.id...
asked by 03.08.2017 / 14:47
4
answers

Reuse ajax

I'm trying to reuse ajax to make it more mobile in my project. Put it in the following way waiting for an answer but no. function _ajax(params,uri,type){ $.ajax({ url: uri, type: type, dataType: 'json',...
asked by 30.05.2018 / 19:23
1
answer

Everything in JavaScript is an object, true or false?

In several responses on this site I have read contradictory statements about whether everything in JavaScript is an object or not. What is the truth? The idea is that the answers are based on reliable sources, preferably in the ECMAScript...
asked by 10.07.2017 / 00:54
1
answer

configure routes and sub-routes using ui-router

I am migrating an application to angular, but I got a bit involved with the routes, especially with the sub-routes, which I have the following problems and doubts: Structure of my application The passage of the index to the loading i...
asked by 10.03.2016 / 23:44
3
answers

Simplify multiple "else if" based on the value of a string variable

The following code works and has 4 conditions but I want to simplify it since they are really 150 conditions, is there any other way to reduce this algorithm and not 150 else if? for (var j = 0; j < $scope.cants.length; j++) { if ($scope....
asked by 19.01.2016 / 16:49
4
answers

Private methods in Javascript classes

My question is how to define private methods in javascript classes so that they can not be accessed directly. class User { constructor(name, password, email) { this.name = name; this.password = password; this.email = e...
asked by 08.02.2017 / 16:38
3
answers

How to join two html pages without using iframe

The idea is that if I have two HTML pages I can join them, and I can call their methods and the DOM between both pages, without using a controller like PHP Example: pagina1.html <!DOCTYPE html> <html> <head>...
asked by 27.04.2017 / 12:55