Questions tagged as 'javascript'

1
answer

Search Index of the array from the json value using indexOf

I have the following array: var usuarios = [ {nome: "João", id: 1}, {nome: "Maria", id: 2}, {nome: "José", id: 3}, {nome: "Ana", id: 4}, ]; I need to return the user index José. I tried using indexOf as follows: var...
asked by 16.06.2016 / 02:12
2
answers

Regular "permissive" expression to detect allowed extensions and hosts

I have a list with some links https://www.exemplo.com/ https://www.exemplo.com/home/ https://www.exemplo.com/logo.png https://intranet.exemplo.com/ https://admin.exemplo.com/login https://www.exemplo.com/sobre/ https://www.exemplo.com/shell.ph...
asked by 18.06.2016 / 22:31
1
answer

Is there a technique for reporting Javascript errors?

It is the following: I use the Laravel Framework and, in it, I configure the application so that when a server error happens, it sends me an email, writes to a log file and / or sends me a message in the Telegram. This kind of helps me anticip...
asked by 26.10.2018 / 18:27
2
answers

Change the color of the Javascript input

My question is: I would like to change the color of a input according to the value in the calculation made. For example let's assume that the value of input name="comparar" is 5 and the result of calculating input name="co...
asked by 03.10.2018 / 20:38
3
answers

Update $ scope in AngularJS

The problem, in a general way, is that I can not pick up information I received on a controller and apply it to my html, when I try to print it instead the variable on the screen is empty when I give console.log on my scope, the information is th...
asked by 08.04.2014 / 04:35
1
answer

Pass a JSON from the view to the route

I'm trying to send JSON of view to a route, but I can not. Unfortunately I know little about JSON , ajax , GET and POST . In the view, json: var json = { "numeroMesa": numeroMesa, "itens": itens }...
asked by 03.02.2016 / 16:53
2
answers

Special Accents and Characters in Ajax jQuery

I have a query that is done with Ajax request via jQuery. In the fields when I type a character as "ç" and send the request to the server, it is arriving with the character in another format. Ex: I type ç in the name field and it arrives in Acti...
asked by 09.05.2014 / 16:17
2
answers

Add days to date of input date

I have a input of type date, I would like to add to it 7 days and put that value in another input also of type date, I tried to do so: <script> $('#txtSolicitacao').on('blur', function(){ data = $('#txtSolicitacao').val...
asked by 04.03.2016 / 18:12
1
answer

Working with Canvas - Borderless

I have a canvas on my page and would like to remove the border .... so I can not ... which property works with the border? function desenhaBase(canvas, context, x1, y1, x2, y2){ context.fillStyle = "white"; c...
asked by 17.12.2014 / 13:00
4
answers

How to get the "src" value of an "img" tag through Javascript and copy it to clipboard?

I want to make when when clicking on an image, your url is copied to the clipboard, I tried to use Clipboard but I was only able to copy the text. var a = document.getElementById('id' + img).src.toString(); alert(a); I want to do this but w...
asked by 02.03.2016 / 17:49