Questions tagged as 'javascript'

1
answer

Toggle text color according to background color

How can I change the color of a text, according to the background color in which it is inserted? I've seen this a few times. It works like this: if the background is light, the text turns black, and if it's dark, the text goes white. I've...
asked by 07.03.2017 / 14:41
1
answer

Popular select dynamic with javascript

I have two select, and I want the second to only show the data depending on the selection of the first one. What I lack is 'popular' the second select, because I already have the necessary data to put into it. As I'm starting with JS I do not kn...
asked by 07.03.2017 / 06:44
1
answer

Video tag by createelement

I'm creating a whole page using the Document.createElement () method, but I'm having a problem creating a video tag. It creates the element but does not play the video, I would like to know if the video tag works with createElement. var ta...
asked by 09.02.2017 / 11:14
1
answer

Which format is most appropriate for the LocalDate field in JSON?

I have seen date fields returned in the following ways: "2012-04-23" //Padrão ISO 8601 "23/04/2012" //Pronto para renderização no front-end Considering the use and flexibility of the front-end, such as performing a search on a grid with...
asked by 09.02.2017 / 18:46
3
answers

Prompt in javascript does not redirect

I have the following script on a page: <script> function fnPage(){ var page = prompt("Para quel página deseja ir?"); if (page != null) { location.href="http://" + page; } } </script> W...
asked by 10.02.2017 / 13:31
1
answer

Calling function in JavaScript at the wrong time

Good night, I'm trying to create a page that displays an image in a modalBox with the zoom function, but I'm facing the problem that even if you click outside the image thumbnail, the zoom function is running, solve? The code is below: <spa...
asked by 01.02.2017 / 01:35
1
answer

Using .append () or .html () - jQuery

I'm not able to insert html into an element. JS function carregaAgendamento() { var url = "http://prestoexpress.com.br/vistoria/json.php"; $.getJSON(url, function(result) { console.log(result); $.each(result, function(i, field) { v...
asked by 01.02.2017 / 22:46
1
answer

How to identify the child element clicked through the click event on the parent element

I have the following code: <div class="tipo-cadastro"> <div class="box-logista active">Logista</div> <div class="box-distribuidor">Distribuidor</div> </div> and the following code in javascript /...
asked by 01.02.2017 / 18:31
1
answer

Get a JSON PHP Via Jquery

I have 3 pages, 1-Index, where I pass some settings; 2- game_data.php, where a query is made and returns a json with the data; 3- juego.php, The page where the json data is displayed is displayed. My difficulty now is, get this data from Json...
asked by 28.01.2017 / 01:45
1
answer

Save images to device without expiring

I have an application made with Intel XDK, running on iOS and Android. The purpose is to display images that are on the server, and store them on the device to not download every time it appears. Then, in addition to storing, you would need t...
asked by 27.01.2017 / 15:22