Questions tagged as 'javascript'

3
answers

Change image using mouseover

My goal is to move the mouse over the image, it changes to another. HTML <body> <img src="ikefeliz_2.png" id="imagen"> </body> Js window.addEventListener('load', iniciar, false); function iniciar(){ var imagen=doc...
asked by 13.08.2017 / 16:12
3
answers

Problem with recursive multidimensional matrix

I need to make a recursive multidimensional array in javascript. I have made a function that clones an array, and I thought what the function of the matrix would be, but I do not know what I'm doing wrong. I want, for example, matrix([2,3,...
asked by 23.11.2016 / 02:43
3
answers

Javascript - Find similar words in an Array ()

I have the following Array () palabras = ["anatomia","ana","angie","anatómico","anatómica","análisis","analogía","analizar","anabólico"]; Now, in HTML I have: <!-- Qué complicado, oh mi Dios --> <input type="text" name="palabra"...
asked by 06.12.2016 / 16:02
3
answers

make Javascript work when several events happen

Good morning! I have 5 inputs which I want to show in a label the sum of the 5 but dynamically, that is to say as I go digitanto the numbers in the inputs, example if in the iunput 1 I typed the 3 and in the input 2 digité the 4 show me immed...
asked by 05.04.2018 / 16:32
2
answers

Uncaught ReferenceError: $ is not defined

I do not know why I get that error if jQuery is the first library I import, I'm working with Laravel and this is what I have in my app.js file import jQuery from 'jquery' import My_Script from './script/myscript.js' and in the wlcome.blade...
asked by 02.04.2018 / 03:16
1
answer

Get object values Rest JavaScript

I make a request with Ajax to a web service and this one decuelve an object. $(document).ready(function () { $.ajax({ url: "https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&a...
asked by 31.05.2018 / 10:05
4
answers

Change margin-left according to the coordinates where you clicked

I want that when I click on the screen I take the coordinates and those coordinates are placed as a value for the margin-left. This is my javascript code. function coordenadas(event) { x=event.clientX; y=event.clientY; document.getElementBy...
asked by 30.03.2017 / 16:51
2
answers

How to format Chilean Rut with points and script when entering it in the input

When entering a routine it is validated, but I would like to format it so that when it is entered it will be in the format 1.234.567-8 or 12.345.678-9 I have tried this way: function validaRut(rut){ var suma=0;...
asked by 03.07.2017 / 15:20
2
answers

How does a return a || b of a function in recursion in JavaScript?

This is a recursive function to show on the screen how to obtain X number through a mathematical calculation where you can only sumar 5 (+5) or multiplicar por 3 (*3) , having as base the number 1: Example: If I want to get...
asked by 11.08.2017 / 00:50
1
answer

Nothing to repeat error

This code what does is find in a string the indexes of "[" and "]" , then with substring, I only take the part inside the brackets. Then I draw them in a canvas according to the if: a string that is without the conte...
asked by 29.06.2017 / 13:48