0
votes
3answers
21 views

Adding Click event for Array Elements in javasctipt

I am new to javascript I have a multi dimensional array which has 'li' in it. i want to add click event listener for all the li in my multidimensional array my array is like this newItems = [ ...
0
votes
2answers
33 views

how to search data from array in java script

I have array in javascript. I want that when i enter any index of array in text field it should return the value of that array and display it i am using following code <!DOCTYPE html> ...
0
votes
2answers
48 views

Decode an json_encode array in PHP

Am I missing on on something in the javascript to decode the array (that has been encoded)? $jsonreturn = array('Condition'=> ...
0
votes
1answer
70 views

Simplifying a javascript with multiple functions to a single function array

So I'm trying to simplify my script from having to use multiple functions with setintervals and clearintervals to have only one function that can be run simultaneously as if it were a bunch of ...
0
votes
3answers
19 views

Javascript: Get input and set it to Array name

I have a collection of arrays in my script, as follows var data0 = [100,10,15,20]; var data1 = [5,100,15,20]; var data2 = [5,10,100,20]; var data3 = [5,10,15,100]; I am getting an input through a ...
1
vote
2answers
33 views

Calling asynchronous functions identified by key

I'm trying to call a group of asynchronous functions identified by parameters. Example: callFunctions("A,C"); would call both objFns["A"] and objFns["C"]. The problem I have run into is that ...
0
votes
1answer
32 views

underscore.js - shortest way to convert a list to an array [closed]

What is the shortest way to convert a list (a FileList object, or another array-ish browser data structure) to an array using underscore? Curretly I use this (in CoffeeScript): files = ...
0
votes
1answer
22 views

Accessing a multidimensional array using a one dimensional array in Javascript

If I have the following initialized... (fyi, in the code I'm basing it off of, both variables are dynamically created) // Start of Code that MUST stay unchanged. var myPrimaryArray = ...
0
votes
1answer
89 views

How to reset counter for array when value changes for a form element?

I have to create business rules for 5000+ different combinations (150+ items, each combined with 6-10 sets of options). I've created this function in order to automatically generate the combinations, ...
0
votes
2answers
23 views

In localStorage how do we save similar tuples with index?

In our extension, we are getting values of username( eg: Johnny123), accname (eg: Facebook). I want to store this for multiple accounts and usernames in the localStorage. We have written this code : ...
0
votes
1answer
41 views

How to “name” the results of an ajax call

I Can use the following code to allow a user to only choose one of the autocomplete options when filling out a form, works perfectly: var validOptions = ["Bold", "Normal", "Default", "100", "200"] ...
0
votes
2answers
27 views

How does this snippet for removing duplicates from an array work

Regarding this post (Remove Duplicates from JavaScript Array) on creating a new array of unique values from another array. Code in question: uniqueArray = myArray.filter(function(elem, pos) { ...
0
votes
1answer
44 views

How to trigger a certain event in Javascript

First of all sorry for the bad question, I don't know how to write it well in one sentence. Here is my scenario, I am making a game where 3 pictures are displayed on screen and along with a word. ...
-7
votes
3answers
43 views

Javascript array: How to push within a condition scope? [closed]

I want to push an array within if-scope, like: var a = new Array(); function funcname(i) { a[0] = "first"; a[1] = "second"; if (i == "condition") { a[2]= "third"; a[3]= "fourth"; } ...
1
vote
3answers
24 views

Linking javascript variables to object values.

I was looking at Backbones v1.0.0 source code and noticed something interesting. In the Backbone.Events object the "on" method seems to be linking a variable to an object value: on: function(name, ...

1 2 3 4 5 327
15 30 50 per page