Questions tagged as 'javascript'

2
answers

Question innerWidth & innerHeight

Hello, I do not think the size of the screen changes when I resize the screen <!DOCTYPE html> <html lang="es"> <head> <title>Práctica</title> <meta charset="UTF8"/> </head> <body>...
asked by 20.12.2017 / 18:37
2
answers

How to trigger a keyboard event with a specific key

I need to trigger a keydown key event simulating that the user pressed the escape key. window.addEventListener('load', init, false); function init() { var input1 = document.querySelector('input[name="text1"]'); input1.addEventLi...
asked by 18.12.2017 / 17:16
2
answers

Capitalize words [duplicated]

I have this code that makes all letters lowercase if the user is capitalized function mayusculas(aqui){ var pepe="KarlanKas"; palabras=aqui.value.split(" "); for(a=0;a<palabras.length;a++){ letra=palab...
asked by 13.12.2017 / 23:52
1
answer

How to use a controller function in another ANGUALRJS controller

I am doing a REST where I try to call in a function, a function of another controller, but with $parent I do not show the function in the console nor with $scope , the function that I try to call is this $scope.getInsuranc...
asked by 19.12.2017 / 21:06
2
answers

Detect click only on the PNG image in javascript?

Well, what I want is to know if there is a function where the click is detected in the image but not in the emptiness (in the transparency), for example in the phaser framework there is a function where this is done which is this var image= g...
asked by 06.01.2018 / 04:46
1
answer

Difference between creating object stability through constructor function VS class and constructor

I do not understand the difference between these two examples, one with class and another with a constructor function function personOne(name, age) { this._name = name; this._age = age; } var p = new personOne("David", 21);...
asked by 12.01.2018 / 16:52
1
answer

MULTIPLY AND ADD

I have the following table a column with established values and another column with the result of the multiplication of the values, and at the end of the table I have a cell which is the sum of the multiplication results ... I have tried in seve...
asked by 11.01.2018 / 22:35
3
answers

Identify isolated regions in a matrix (error in some special cases)

I need to separate the different regions or "islands" formed by 1s within a matrix of any dimension. My example seemed to work correctly but there is some "special" case like the next one that does not work well. It should detect 2 elements o...
asked by 05.12.2017 / 10:03
1
answer

How do I pass an image from my view to a controller? MVC

Hi, I have the following problem, I need to get an image of an input and pass it to the controller; The code I use is the following: HTML: <div class="row"> <div class="col-xs-12 col-sm-10 offset-sm-1"> <input name="...
asked by 19.04.2018 / 05:34
3
answers

How to travel with foreach backwards forward

I am doing a blog and I would like the blog entries to be shown from the newest to the oldest, I was wondering if there is any way to go back and forth with a foreach. The code I have now is this: <% blogs.forEach(function(blog){ %> &...
asked by 16.04.2018 / 14:29