Questions tagged as 'javascript'

1
answer

How to create synchronous functions to get the same behavior as confirm?

I'm trying to recreate the native confirm component of javascript and I came across a question. Example: if (confirm("meu texto vai aqui")) { // Aguarda retorno {true ou false} console.log("faça algo aqui"); } By default, as long as...
asked by 24.05.2016 / 15:36
2
answers

Regex to validate data yyyy / mm / dd?

I have tried several expressions, but I did not get the desired result. How can I validate the date for yyyy/mm/dd ?     
asked by 25.05.2016 / 17:08
1
answer

Knowing which slide is passing in the bootstrap carousel

I have a carousel slide from the bootstrap, I wanted to know when a certain slide is going on the screen using javascript or stop at the last slide.     
asked by 26.05.2016 / 02:49
2
answers

Take Action of the Form and the Submit button.

I'm trying to unravel the mystery, when the user clicks the "Submit" button, the content of the form is sent to another file. The attribute action defines the name of the file to send the content to. The file defined in the attribute...
asked by 21.05.2016 / 22:09
1
answer

Delete variable provided when unchecking Checkbox

I have a code that saves in a textarea values from a checkbox, but I can not get the value to be cleared from the textarea when the checkbox is unchecked. var checkbox = document.getElementsByName('CP[]'); var teste = []; function ad...
asked by 24.05.2016 / 18:44
1
answer

How to send a message to a specific room with Socket.io?

How do I send a message to a specific room? type: server.js io.in('roomA').on('msg', function(msg) { ... }); client.js io.in('roomA').emit('msg, 'Hi');     
asked by 22.05.2016 / 03:55
1
answer

EventListener does not work with 2 or more inputs

So, my friends, I have a page with a for that does create several forms. In each form I have an input file, which I want to handle individually. However, when I try to use some eventlistener, it only works with the first input of the for. I do n...
asked by 11.02.2016 / 17:20
1
answer

Doubts about grunt

I'm not very experienced in javascript and wanted to know what a production version would be. I'm using Grunt to concatenate and minify my application in order to make it smaller. The files generated by this process (app.js, app.min.js) will s...
asked by 10.02.2016 / 13:49
1
answer

ionic push notifcation error

To do an ionic project to receive notifications (android) and I'm using the phonegap-plugin-push plugin. var push = PushNotification.init({ "android": {"senderID": "860498722229", icon : "icon"}, "ios": {"alert": "true", "badge": "tr...
asked by 10.02.2016 / 23:56
2
answers

Function for handling all date type parameters in a multilevel object with Javascript

I need to create a function that works on all the parameters of a JSON object to look up data fields and manipulate them. Basically the object I can receive is something like: { idPedido:1, dataCriado: "/Date(1454637600000-0200)/", clien...
asked by 10.02.2016 / 18:12