Questions tagged as 'javascript'

4
answers

How to dynamically create properties in C #?

In JavaScript it is easy to create an object with new properties. var obj = { "propriedade1" : "valor", "propriedade2" : "valor" } Is it possible to do something similar in C #? var lista = new List<Object>(); foreach (var ite...
asked by 08.06.2015 / 19:38
3
answers

Difference of hours between two dates with JavaScript?

Hello. I have these two dates: var dtPartida = "20170620 11:20"; var dtChegada = "20170620 16:40"; You need to find out the difference in hours between these dates in the case and 5 hours and 20 minutes. I need it to return like...
asked by 16.06.2017 / 18:08
4
answers

How to count how many times a value appears in a table

How to count how many times a value appears in a table? Example: <table id="table"> <tr> <td> 2 </td> </tr> <tr> <td> 6 </td> </tr> <tr> <td> 2 </td&...
asked by 01.09.2014 / 23:13
7
answers

Push element from one array to another array

function that accepts a parameter and is a numeric array and it will cross the array and if the element is even it will push to the one "par" array and if it is odd it will push to the "odd" array I tried to do it this way below but nothing w...
asked by 29.08.2018 / 22:20
3
answers

What is the difference between function () {} and () = {}? Why does not $ http.get work?

When I use $http.get('/products').then((response) => { this.products = response.data; this.allProducts = response.data; }); The page loads with the products in Google Chrome, but when I use $http.get('/products').then(function(...
asked by 29.07.2016 / 16:36
3
answers

How to block adblock? [duplicate]

I'm building a site that works with ads and so I can not allow a user to enter adblock, I tried to use the www.antiblock.org script but it only works on one page, another page where I work with navigation without refresh using ajax it blocks t...
asked by 17.04.2016 / 20:27
1
answer

Hexagons grid - return neighbors

I'm writing a game simulator called Iso-Path. It consists of a hexagonal grid, being itself formed of hexagons You can see what I've already done on this link But I packed the time to pick up the neighbors of a certain cell. For examp...
asked by 29.08.2018 / 16:51
1
answer

How to adapt my code to Android 4.1?

I'm making an application using Materialize. But there is a mistake. The MENU is to work as in the second image. It is hidden with TranslateX(-100%) . And when I click on the MENU icon it opens the MENU. But when I open the applicati...
asked by 22.11.2016 / 12:14
2
answers

How to avoid HTML injection and XSS in .JSP pages?

No PHP I have seen uses of htmlspecialchars and mysqli . But in Java is there any way to avoid XSS and HTML injection? I'd also like to know what would be the best (safest) way: Escaping the elements ( HTML , Java...
asked by 17.04.2015 / 18:42
1
answer

Failed propType: Invalid prop 'children' supplied to 'Router'

I created a project to study react and I'm trying to uncouple my Header from the app by creating a component for it. I created a Header.jsx file and passed the code there but I am getting the following error:    Failed propType: Invali...
asked by 06.01.2016 / 17:46