Questions tagged as 'javascript'

2
answers

Ajax does not run correctly

The structure of my project is as follows: and I have the following code: Login_inicio.html <!DOCTYPE html> <html lang=""> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" conten...
asked by 21.12.2017 / 05:13
4
answers

How to divide an array into two?

How to divide this array into two independent arrays of whatever length. Between the two arrays they must contain all the students, without any of them repeating themselves. Thanks var alumnos =["Carlos","Clara","Cristina","Fernando","Ivan","L...
asked by 18.12.2017 / 18:58
2
answers

Error validating a form with JavaScript when you press a key or lose focus

I am trying to put a validation on the client side of some forms on my web page, even adding a class to show the error, or I have already added a document.write due to desperation. Such is the thing that these would be my validations a...
asked by 09.05.2017 / 09:32
2
answers

Javascript: changing the value type of a variable

Reading about JavaScript I found this example with two notes: var message = " hi "; message = 100; 1) We declare message as String and then overwrite it as a variable of type integer , it is valid but NOT recommended....
asked by 29.04.2017 / 05:42
1
answer

What is the difference between using ++ or - - in front of or behind a variable? [duplicate]

Having this variable: var edad = 22; We apply the unary operators: ++ and - -, both before and after the variable, in the following way: console.log(++edad); \ 23. console.log(--edad); \ 21. If we apply at the end: console.log(eda...
asked by 29.04.2017 / 17:09
1
answer

Canvas inside forEach

I need to draw a canvas for each element of the matrix, but I do not draw anything with the foreach, but if I take out the foreach and the function per and I only leave the drawing of #nodes if it works, but clearly it only draws me once....
asked by 04.05.2017 / 13:05
2
answers

Get ID of the options of a select with JavaScript

I am working on a PHP project and I use the Laravel 5.4 framework, and I want to get the selected id of a select . And that's how I have my select and how I fill it with the data: <select name="location_id" id="addLocationId...
asked by 03.07.2017 / 21:54
2
answers

Owned by a builder

The prototype of a constructor is a function. So, why in this case do you throw false ? function A() { this.n = 15; } A.prototype = {b: 2, c: 3}; Function.prototype.nn = 15; console.log(Object.getPrototypeOf(A)); co...
asked by 04.07.2017 / 17:37
3
answers

List String in a PHP / jQuery select

I have the following string:    1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24 ; 25; 26; 27; 28; 29; 30 Stored in the BD in a single field varchar 300 , Can this string be broken into separate...
asked by 23.03.2017 / 15:57
3
answers

Thousands separator with php or Jquery javascript [duplicated]

I'm trying to make a "peso" currency format for my input, where I want it to be formatted automatically when I enter with thousands separator (".") I have tried several codes and they do not work     
asked by 29.06.2017 / 23:25