Questions tagged as 'javascript'

2
answers

How to create a regular expression to validate just a mobile number?

I made this expression, but I do not know if it is in today's patterns "/^[1-9]{2}\s?9\s?\d{8}$/"     
asked by 21.06.2017 / 18:46
1
answer

Execute function when closing javascript tab

Opa, I need to run an ajax when closing the tab, is it possible? I tried: window.onbeforeunload = ConfirmExit; function ConfirmExit() { $.ajax({ url:'salvar.php', data:{usuari...
asked by 13.06.2017 / 21:19
1
answer

Generic Dialogue in thymeleaf

Good evening, friends, Has anyone tried or ever done a generic dialogue on thymeleaf? What I want is: Instead of writing code to confirm the deletion of a data on the screen is something simple, I would like to make a generic, where I w...
asked by 02.04.2017 / 01:54
1
answer

Compare Div Value

You can sweep a div and return it. For example: <div class='result' id='add9' align='middle'> 1</div> <div class='result' id='add9' align='middle'> 2</div> <div class='result' id='add9' align='middle'> 3</div&g...
asked by 31.03.2017 / 23:08
1
answer

Unexpected behavior in asynchronous javascript

I am writing a backend code using javascript, node and the npm modules 'mysql' and 'request'. I tried to write a module to do a pooling of SQL database connections by different API calls in various files of my project. My module mysqlLib.js: v...
asked by 31.03.2017 / 04:48
1
answer

Implementation of a search box

Good evening, As for the short time I learned HTML5 and CSS3, I am learning JavaScript at the moment. I'm creating a webpage but I'm having difficulty in the search box creation part. I have already created it (I used the input tag with name=...
asked by 31.03.2017 / 05:52
1
answer

How do I make a button process the same function more than once?

I am doing a Pomodoro Clock, it consists of a clock that is a countdown of 25 minutes, after that 25 minutes has a Short Break, which is a 5 minute break for rest. My HTML5 code has two buttons that when clicked trigger a function to start the c...
asked by 19.02.2017 / 17:51
1
answer

Function of "Like it" without reloading the page?

Hello, good afternoon! I'm having a problem that I do not know how to solve. I do not know how to program in JQuery or Ajax, but I intend to start learning. How can I do to make the following code in PHP work in Ajax or JS? Which of the two o...
asked by 22.02.2017 / 18:16
1
answer

PrimeFaces - Select DataTable row via JQuery, Javascript or PF

How do I select a row from a DataTable, using JQuery, pure Javascript, or the javascript PF command?     
asked by 13.02.2017 / 15:25
1
answer

Problem with tr of table inserted via javascript

function cadProd(){ var nomeProd = document.getElementById("nomeProd").value; var categoria = document.getElementById("categoria").value; var descricao = document.getElementById("descricao").value; var un = document.getElementById("u...
asked by 14.02.2017 / 17:50