Questions tagged as 'javascript'

2
answers

How do I make the alert fade after I display it on a div?

I'm doing an application using JavaScript and JQuery, and when I put an alert to display an error in a div, it does not disappear, just by clicking on the x to close, I'd like to know how do I get rid of it after some time. Código HTML <d...
asked by 27.06.2018 / 01:01
2
answers

Find Array Value in Object

I have the following object: let Filmes = [{ "Nome": "Harry Potter 1", "Preco": "50" }, { "Nome": "Harry Potter 2", "Preco": "60" },...
asked by 23.01.2018 / 13:15
2
answers

How to use preg_match () to get a link inside a Javascript code

Hello, I'm doing a file_get_contents() in PHP and getting a JS, in that javascript has a code where it contains: $("#download-botao").attr("href", "link.com"); I want to get this link.com in my PHP, I'm trying to preg_match() ,...
asked by 01.08.2018 / 01:25
4
answers

Repetition of color zebra only that of 5 in 5

How to make this repeat loop to have 5 numbers of one color and 5 numbers of another color? var collection = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; var html=''; for (var i in collection) { var cor = (i % 5 == 0) ? 'red' : 'blu...
asked by 16.05.2018 / 17:29
1
answer

How to check if an id exists?

This script is not working, I just want the thumb variable to be created if the thumb id exists, if the script does not exist. It seems that when the thumb does not exist it gives an error and the script does not work. Note: I'm only using Notep...
asked by 20.09.2018 / 10:09
3
answers

Capture array element javascript

Hello, how can I capture the name maria of id 2? listform: [ { id: "1", nome: "juana" }, { id: "2" nome: "maria" }, { id: "3" nome: "carlos" } ]     
asked by 10.10.2018 / 15:38
3
answers

Mask in table values

I am looking for a way to create "masks" for the values of my table in ASP.NET. Currently, I'm displaying values like this: @model TB_RESUMO_GERAL List<TB_RESUMO_GERAL> rg = (List<TB_RESUMO_GERAL>)ViewData["relatorioGeral"]; ....
asked by 03.08.2017 / 16:13
2
answers

Format date with javascript [duplicate]

I'm developing an application in which I get the postings of a page on facebook and I need to format the creation date of the post I get via json as follows: 2018-01-12T11:25:41+0000 What function should I use to format this date into the...
asked by 12.01.2018 / 18:11
2
answers

Access an element of a JSON dynamically

I have the following JSON: [{ "posts": { "ID": 452, "post_date": "01\/01\/2016 15:30:00", "post_title": "Titulo do post" }, "postmeta": { "anexo": { "size": { "value":...
asked by 20.07.2016 / 16:24
3
answers

List array according to what was selected

I have select with some mobile operators: <select name="valor" id="operadoraRecarga" class="form-control operadoraRecarga"> <option value="claro">Claro</option> <option value="tim">Tim</option> <option v...
asked by 29.08.2016 / 21:05