Questions tagged as 'javascript'

1
answer

Dynamic slot value

I would like to know how to make the contents of the slots dynamic, in this case with the name / value of the product. What I have is: // register modal component Vue.component('modal', { template: '#modal' }) // start app new...
asked by 28.09.2017 / 10:56
1
answer

Drag and Drop: Dropping image within another image

Good afternoon, I'm doing a Drag and Drop code and dropping an image inside another image, it just adds
asked by 19.09.2017 / 21:22
3
answers

Get original image dimension with JavaScript

I have an image uploaded to my HTML page within the tag <img> , is there any way to know its original file size by JavaScript >? Let's say I want to give console.log(larguraImagem, alturaImagem); .    Note that the s...
asked by 22.09.2017 / 16:18
2
answers

Image not displayed when being listed in Node Js

I am not able to list the images saved in the e node with the express, when I try to list my View does not display the image. My configuration file: module.exports = function(){ //recuperando a biblioteca do express var express...
asked by 29.09.2017 / 19:40
1
answer

Array.splice does not work as expected

For example: var frutas = ["goiaba", "manga", "laranja", "abacate"]; frutas.splice(1, 1); This code, instead of removing 1 item from the second index of my array (1), only returns the item I want to delete, which in this case is "orange";...
asked by 19.09.2017 / 04:07
1
answer

Creating array from another array

var contatos = [ { nome: 'Alex Silva Souza', endereco: 'Travessa 1, casa 233', tel: '2235-3514', id:1123, email: '****', }, { nome: 'Beatriz Santana Pinto', endereco: 'Rua cardoso de moraes, casa 21', tel: '3...
asked by 04.10.2017 / 14:58
1
answer

toLocaleString Brazilian R $

I have a simple question about toLocaleString , I did not know this prototype and I tested it instead of doing the good old split and replace var a = 10000.50 var b = a.toLocaleString('pt-BR') console.log(b) T...
asked by 06.10.2017 / 20:50
3
answers

How do I trigger an event when the value of a variable changes?

Is it possible to create a custom event so that when a variable has its value changed something happens? If yes, how to do this? For example: In a trick game I want when the variable state changes to "bot" I want the bot to play, several func...
asked by 30.09.2017 / 15:55
1
answer

Doubt over assignment of variables in Ecmascript 5

My question is related to the behavior of a variable, since it is assigned a dynamic value in it. For example in the code: var x_position = window.getComputedStyle(elemento).marginLeft; Doubt: Every time I have to read the variable...
asked by 30.09.2017 / 23:01
2
answers

Namespaces for animations in jQuery

For those of you already familiar with using jQuery, using the jQuery.fn.stop function is a simple and common thing when working with different animations on a common element. My question is about creating jQuery extensions. I have alr...
asked by 12.03.2014 / 14:04