Questions tagged as 'javascript'

1
answer

Removing fields from a list

I have a question. I created a list and wanted to remove the elements from it by clicking on the 'x' as in the following image (I put x by paint): HowcanIdothis?Isitanattributeorisitconfigurablebyanotherlanguage??Forgivenessofignorance <...
asked by 23.10.2017 / 17:47
3
answers

Filter array of dates

I know that there is .filter() that in it I can filter an array to return it just the way I want it, and using a lot to search, when we pass what we want to search in that array. But I'm having trouble filtering an array of dates like...
asked by 17.11.2017 / 17:17
2
answers

How to remove an object from an array, if it exists, with json string

I'm trying to create a sort of wish list. By clicking a button / product it populates or deletes, if it already exists. However, I can not delete it, I can only include it. I tried using splice , but it only works with array. The problem is to...
asked by 23.11.2017 / 18:40
2
answers

Handle JSON by Javascript

After ajax, my return from php is: [{"1":"4"},{"2":"3"},{"3":"7"}] Data is variable in quantity and content. I need to treat it with javascript and convert it into an array, in this format: var retorno = [ [1, 4], [2, 3...
asked by 29.08.2017 / 03:56
2
answers

Ties with arrays array not working

Why does y in second for not "run"? var i = 0; var bd = new Array(); bd[i++] = new Array(10,11,'Daniel'); bd[i++] = new Array(12,12,'Augusto'); bd[i++] = new Array(13, 12, 'Olavo'); Notice that I run the coordi...
asked by 28.08.2017 / 16:46
2
answers

Show and hide DIV according to the user level

I need to display some div elements according to the logged-in user level. If the user is level one can only sample certain div 's. Here is the display: <div id="hmn0" style="margin-top:0px;"> <nav> <di...
asked by 22.08.2017 / 19:50
3
answers

Compare 2 arrays and save the difference between them in the database?

I have 2 object arrays, one of them is the one composed of emails that comes from the provider through IMAP protocol and I convert to objects and then put them in an array all of them. The other is an array of emails that I look for in MongoD...
asked by 05.09.2017 / 22:21
1
answer

Passing value from javaScript to php

I can not pass the value of php to javaScript really is that way? var session = "<?php session_start(); $_SESSION['NOME'];?>" alert(session); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js">&l...
asked by 17.08.2017 / 20:12
1
answer

I want to "" in the numbers of my JSON

I have a script in node.js that takes json of a site that comes in this format: {"nome123":123.4,"nome213":231.4."nome123":123.4} I want to quote the numbers and leave it like this: {"nome123":"123.4","nome213":"231.4","no...
asked by 22.08.2017 / 12:21
2
answers

Random Card Deck

I'm creating a site for people playing cards with php. I would like to know how to create a deck of 50 cards for each person. In the database I have a table with 300 different cards and of these 300 cards I want the user to register generate 50...
asked by 26.08.2017 / 01:18