Questions tagged as 'javascript'

1
answer

Compare with if on objects of JS objects

I need some help but I just can not find a way to solve that little doubt I have, I'm trying to make a comparison to get true / false from an Object in JavaScript, for example I have that result in the Chrome console: {sortBy: "price_asc"}...
asked by 04.09.2018 / 17:28
1
answer

Syntax Error Java Script code restaurant bill

I am running this code and I really do not find the error ... I would like to know more points of view or suggestions so that the execution of the code results without error. Thank you in advance!:) In the following image, tax is the tax and...
asked by 16.08.2018 / 07:58
2
answers

Why does not the return return the correct value?

I want to return the value of console , but it does not return anything. This is my code: function findOutlier(integers) { let odd = integers[0]; integers.forEach(function(current) { if (odd % 2 == 0) { if...
asked by 11.01.2018 / 15:49
2
answers

how to load several pages on the same page

I made a menu and the idea is that when you click on any of the options in my menu I do not recharge another page, but in the same page where the menu loads the page that corresponds to the option that was given click, I do not know how to do it...
asked by 12.01.2018 / 03:31
1
answer

effect hover in image

I am building a gallery with images where the image has an effect of hover when hovering over the mouse, in addition to the text in the hover I would like to see a bordering to the right and below the text, that is right and bo...
asked by 28.11.2017 / 13:24
4
answers

Detect click and double click on HTML

How can I do to detect if a simple click or double click on an HTML element <div> I have tried the following code: <div onclick="alert('un click')" ondblclick="alert('doble click')"> Click aqui</div> The problem is...
asked by 29.11.2017 / 20:46
1
answer

error ajax function

I have this code in a php file: <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <?php //Tab...
asked by 16.11.2017 / 17:18
3
answers

How to limit the values of a property of an object in JS?

When creating an object, the specialty field can only have the values 1, 2 or 3, how can I limit it? function Sandskill(nom, edad, especialidad, comp){ this.nombre = nom; this.edad = edad; this.especialidad = especialidad;...
asked by 14.11.2017 / 15:19
2
answers

Datepicker Dates - Do not open Calendar

I am making an online booking website, and I would like to put on a div the number of nights that the guest will stay at my hotel. My question is this: If I select an entry date (check_in), which automatically checks out on check out date, I...
asked by 14.11.2017 / 22:15
3
answers

Change color to input

I have a input text with a transparent background and what I want to do is change its background when I position myself in it, something like the image but with JQuery or JS     
asked by 27.11.2017 / 17:10