Questions tagged as 'function'

4
answers

How to perform mathematical operations with the values of an array

I have a problem subtracting the values of an array from one another. The sum works perfectly, but the subtraction does not work. It always makes me negative numbers, and that would not be the case. This is my code: var numbers = []; var u...
asked by 17.06.2018 / 13:01
2
answers

How to discard an empty array in a function?

Hello everyone I am working with native js, in this function I return the product of the elements in the array, what I can not achieve is to discard the case of an empty array, it always shows me the 1, but if it resulted in change the value to...
asked by 29.12.2017 / 09:41
1
answer

how do I get these if statement to work?

What happens is that when I run my program, the output repeats the questions more than usual (sometimes 4 times sometimes 2 or 1). My mistake may be because I call the functions many times or because I misuse the if statement but I'm not sure...
asked by 13.10.2018 / 01:29
2
answers

Print div with styles in JS

Good afternoon friends of the community, today I come with a question that I hope you can help me solve, it turns out that I want to print a div with JS but when sending the parameters in the function the styles do not respect them and the file...
asked by 17.05.2018 / 22:32
1
answer

Validate login with JavaScript and ASP.NET

What happens is that I have been trying to validate a login but only validating the password since it is not necessary for the user to use it. I'm doing everything on the client side with javascript in ASP.NET but since I'm new to javascript, I...
asked by 05.02.2018 / 09:16
1
answer

TypeError: 'undefined' is not a function (evaluating 'link.click ()') Safari

How about? I am setting up a page with Wordpress, where you have the possibility of, by pressing a button, you will download a full .csv of all the subscribers to the page. In Chrome, IE and Firefox, this button works, but in Safari it gives me...
asked by 03.05.2018 / 15:15
0
answers

How is the correct way to do an iterable function

I have been working for a few days with a function that operates with data of 2 document .csv . There are many steps, but basically what it does is take identifying numbers (ID) that were categorized from lowest to highest according to the...
asked by 22.07.2017 / 04:49
2
answers

Add items to an array without duplicating them

Friends good Sunday, I need to add data to an Array, I'm making a kind of shopping cart and I'm at the point where I need to add to a list the products that the end customer wants to buy, the way I use is as follows: <div class="col-s...
asked by 22.01.2017 / 21:40
1
answer

Syntax error when creating PHP function

Good day, I have this problem when running a function in PHP, if someone can help me, I thank you in advance public function actionIndex() { // ejecución de la tarea de etl $job = new Job(); Job::start()...
asked by 10.03.2018 / 05:08
1
answer

I want that the image inserted in the canvas does not cross the edges but that these are its limits

var x= 220, y= 730; function lienzo(){ var c = document.getElementById("myCanvas"); var ctx = c.getContext("2d"); var img = document.getElementById("ima"); ctx.clearRect(0,0,c...
asked by 27.12.2018 / 21:32