All Questions

Tagged with
4
votes
4answers
49 views

Extracting all values from a Array of Objects based on keys value

If I have an array that looks like below:[{"matchedKey":"cuisineType","cuisineType":"Indian","group":"group"},{"matchedKey":"cuisineType","cuisineType":"Italian","group":"group"},{"matchedKey":"...
0
votes
1answer
22 views

Find value of key in one JSON file and replace it with value of key from second JSON where value in first JSON matches key in second JSON

I have two JSON files. File1{"dataSet": "w28h46c7XUD","completeDate": "2018-10-23T14:16:11.384+0000","period": "2018Q3","orgUnit": "tBl4WduwWRw","dataValues": [{"...
-1
votes
1answer
26 views

How to Create Nested Array in jQuery using .each()?

I have a case I'd like to solve.so what I want to create is a nested array with structure like this:([0]=>1([0]=>3,[1]=>4), [1]=>3([0]=>3,[1]=>4)).this is the script I use:$('li.dd-head-section'...
2
votes
2answers
22 views

Show item at random from one array when another separate item in a different array is clicked while also removing that item from the first array?

I am working on my first real project, a "Hangman" style game. I am trying to have this action take place and am not sure where I am going wrong: If a 'wrong letter' is clicked, show one of the 'body ...
1
vote
1answer
40 views

Display specific texts if the first 4 children meet the requirements, with Jquery

I have a table with multiple rows and columns. What I want is this: if first 4 of 5 children have specific class, then append a specific text to another div. Else, not. And I am stucked with this code....
0
votes
1answer
54 views

How to get the variable value after the $getJSON?

In the code below, I have a function counter which counts element. I use the counter function in order to count the elements that I have in the JSON file. My question is how can I get the value of the ...
-1
votes
0answers
12 views

Change array data with variable

var x="25"; myMap=new ymaps.Map("map", {center: [/* HERE VARIABLE */],zoom: 17,type: 'yandex#satellite'}...
1
vote
3answers
40 views

how to find array values inside an element and add jquery class to it

I am trying to find array values inside an element and then add a css class to it. Is my technique wrong? Can someone please help me.var numbers=[1, 2, 3, 7, 8, 9, 10, 16, 17, 18, 19, 20];...
0
votes
0answers
29 views

Check table overlap with JavaScript & jQuery

I'm developing timetable web app and I have some problem with it. When I click the button clicked row data will go to under table which I set 'selected subject' table.And I want to make it if the ...
0
votes
1answer
25 views

Create dynamic index for array of object jquery

var menu=[];$('.mainmenu').click(function() {$('.mainmenu').each(function(i,v) {var sub={};var indexmenu=$(this).attr('id');sub[indexmenu]=$(this).attr('data-...
0
votes
2answers
35 views

How to combine array to array multidimensional with object and key

How to combine 2 array to be 1 array with object and key. array1=[a, b, c , d]array2=[z, y, x, w] I want to be an array like result=[[foo: a, bar: z], [foo: b, bar: y], [foo: c, bar: x], [foo: ...
0
votes
1answer
24 views

Javascript/jQuery/JSON/localStorage Game, Trouble sorting ranking table numerically

the below code creates the leaderboard for my completed game, the only thing that I can't get it to do is automatically sort the score high to low. I think I need to put the objects into an array and ...
0
votes
1answer
28 views

Assign new class to label when it's input area has focus

I want to assign a new class to a label when it's corresponding input element has focus.I have a form with 10 input fields and 10 labels for each. const inputFields=document.querySelectorAll(...
1
vote
1answer
43 views

Passing array value between two different click events

How can I pass values ​​from an array from one event click to another with jQuery? Here is an example of I want to do: the first click event adds or remove values from the array if the input ...
0
votes
1answer
20 views

Convert an array to tab-delimited Mailchimp file

I need to convert a JSON array to a tab-delimited version so that I can save it as a .txt file so it can be uploaded on Mailchimp.I would need result like this:"Date","Pupil","Grade""25 May","...
-2
votes
2answers
54 views

How to sort object of objects by nested key

i have an object of objects. i want to sort it on the basis of id.here is my data{1918: {id: "1544596802835",item_id: "1918",label: "Soft Touch Salt Free Mint 500 ml (...
1
vote
4answers
73 views

Loop through JSON array of objects and get the properties based on the matching IDs from objects

My target is if the id from digital_assets and products matches then get the value of URL fro digital_assets and ProductName from products object. I'm able to traverse through the object and get the ...
0
votes
3answers
60 views

How to count the occurrence of each key within an array of objects?

Say I have an array of objects like so:[{"taco":"","burrito":"","scone":"","beans":"true"}, {"taco":"true","burrito":"","scone":"true","beans":""}, {"taco":"true","burrito":"","scone":"","beans":""...
0
votes
1answer
19 views

How to get array from localstorage in Firebase Cloud Functions?

After sending the localStorage to server the const arrayOrders is showing up as empty even it contains values in client side.I've tried to do that with this way but it not works.Here is my code ...
-2
votes
2answers
50 views

Problem to pass JSON / Ajax to PHP variable

I'm capturing the JSON / Ajax response in an id of a span, all right. But I can not save the response in a PHP variable.<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery....
1
vote
2answers
45 views

Checking booleans from multiple arrays simultaneously, without multiple if statements

The code is running okay, but I'm sure there is a more efficient way to do this. At the moment it is working okay in Firefox, but falls to pieces in Chrome. The boolean values are checked at each step,...
0
votes
0answers
23 views

Order array of objects by value in object javascript [duplicate]

I got the following Javascript array of objects: The array of objectsI need to order this array based on the "cppercent" value in the object, but honestly i have no clue how to even get started.
-1
votes
3answers
69 views

Javascript Order array by index

I have an array with clients_id. This array is sort by delivery order.This delivery order can change : I have a function (Framework7 based) with sortable list.I need to sort the delivery list when ...
0
votes
2answers
45 views

Pushing objects to array

I have three html buttons on my page:<button class="timespanbutton" value="1">1</button><button class="timespanbutton" value="2">2</button><button class="timespanbutton" ...
0
votes
2answers
53 views

How to store array with array_push() outside loop?

I have an array, when i tried to print_r was just like this : Array ( [user_id]=> Erick ) Array ( [user_id]=> Baldi) Array([user_id]=> Bintang ) Array ( [user_id]=> Bagas ) Array ( [...
0
votes
0answers
44 views

javascript replace the last object value of the same key

I want to genreate an object in dynamic. I have a JSON file and I want to create an object like.var addfilter=function () {var filtergroup=new $.jqx.filter();var ...
0
votes
0answers
43 views

search by name and array

Hello I'm trying to do a searchbar that can search a name(string) and tags(array). But I dont rteally know how to write the if statement. This is how I want it to look like. Any ideas on how to make ...
0
votes
0answers
39 views

Nested for loops - Order of output for strings in objects and arrays

I just can't figure this one out. So, I have the class team and the class player. Player objects are stored within their team(object).The teams themselves are stored in the listofteams object....
0
votes
0answers
16 views

update json array values and save updated json in external file using jquery?

I create a table by using external json object. It works correctly, but i want to update the given json data by using array format and the updated json values should be stored in another external file....
0
votes
1answer
29 views

jquery multi dimension forloop json

DearsI am struggling to get the below screen workingProject progress screenBelow is the json i generated from PHP, MYSQL. I want the project alongside the user images and names when mouseover. I ...

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,