Tagged Questions
1
vote
3answers
44 views
How to separate variables in to arrays of 3?
So What this is supposed to do, minus the mouseenter/mouseleave functions, is to take user input, divide it in to an array with 3 letters in each array placement (ex. User input abcdef... will turn in ...
0
votes
1answer
26 views
Remove an object from an array and then delete
I am building a system in the MVC design pattern. I need to create a series of controllers. Later I may want to be able to remove these controllers from memory when they are no longer needed. The ...
0
votes
1answer
50 views
2 Arrays in Javascript [on hold]
I have this code to make a songs list in playlist
var cookie = 'songsname,songsname';
var playlistts=cookie.split(",");
var each = playlistts.join('</span><li><img class="plimg" ...
-3
votes
1answer
70 views
Reversing letters in a string but not the words [on hold]
I have an assignment in JS in which I have to reverse the order of the strings in an array that have already had their characters reversed (I already applied .reverse() on the original string "This is ...
0
votes
2answers
51 views
Best way to do an if else block using values within Javascript arrays?
Am trying to do an if else statement using the on("keydown") function in JQuery.
Essentially am trying to alter the HTML depending on whether a particular key within a set group is pressed.
Here is ...
-1
votes
1answer
39 views
Why is this javascript not moving through properly?
I have some lines of code that should function like a slide show my problem is that is will only go to the first image in the array but stops and shows an error: SCRIPT5007: Unable to set property ...
0
votes
1answer
20 views
Array of arrays ? 4 ways linked matrix?
I need to create an object that would represent a bi-dimensonnal array and have the following methods :
appendRow()
appendColumn()
removeRow(uint index)
removeColumn(uint index)
The last two ...
2
votes
1answer
17 views
JavaScript: why use prototype to call a function instead of just calling the function?
Why would you slice an array like this:
Array.prototype.slice.call(arr, 3);
Instead of simply:
arr.slice(3);
?
What are the benefits of using the prototype and the call?
Thanks!
0
votes
3answers
19 views
Get a sequence of images into an array
I was wondering if it's possible to get a sequence of pictures into an array. I'd like to use plain JavaScript, because I have zero experience in PHP or any other language to achieve this.
So I ...
1
vote
4answers
35 views
Declare an empty two-dimensional array in Javascript?
I want to create a two dimensional array in Javascript where I'm going to store coordinates (x,y). I don't know yet how many pairs of coordinates I will have because they will be dynamically generated ...
0
votes
1answer
61 views
Using php variable in javascript [duplicate]
I know I am doing this totally wrong and haven't got an idea how to do this.. basically I have a javascript function and trying to use php to declare as array all teams if round equals to 1. The teams ...
0
votes
2answers
36 views
How to access element in a div within a carousel? [on hold]
I have a carousel that accesses the "src" link of the first image in the div each time it changes.
<div>
<img class="big-image" src="img/large/snow1.jpg" width="400" height="400" />
...
0
votes
5answers
44 views
How can I set the value of a field in a new object to be equal to the highest value of fields in an array? [duplicate]
I have a javascript array that contains objectiveDetail objects.
objectiveDetails[]
Here I am adding a new objectiveDetail:
var emptyObjectiveDetail = {
"number": ...
1
vote
2answers
34 views
In array find match and replace it by jQuery
Here have a array set:
totalarray =[
[1,2,3,4],
[8,9,10],
[15,16,17],
[8,14,20]
]
And I need to make it combine if which set ...
0
votes
0answers
28 views
Pitch detection on array of floating point numbers
I'm doing voice recording in javascript, and storing the recording as an array of signed floats. What would I need to determine (and ultimately, adjust) pitch on the array? I've seen various ...
1
vote
3answers
46 views
Decrypt array to string
I currently have an array that looks like this:
["screen", "left_side", "left_side", "right_side", "left_side", "right_side", "left_side", "right_side"]
I now want to encrypt this somehow so I can ...
1
vote
2answers
27 views
How to split the substring without empty cells?
Example:
"div#qwe.%class-first.class-two".split(/([#\.%])/)
["div", "#", "qwe", ".", "", "%", "class-first", ".", "class-two"]
Cell 4 is empty. How do I get rid of this by using regex?
UPD #1 I ...
-1
votes
4answers
55 views
Mistake in javascript with NaN in an array
When I execute this function in javascript, I get a NaN result. It seems quite ilogical beacuse the arrays employed in this operation are all numerical and are shown properly when I do so with a ...
-2
votes
1answer
33 views
Text field to array [on hold]
I am trying to create an array from a text field. I need to paste fifty lines into a text field. Then convert the lines to an array, with each line being a different element in the array.
1
vote
2answers
53 views
Stopping a function, Arrays, and Integer Check
So I made code for creating 5 ships in a battleship game. I succesfully made some code that layed out all the players ships. It had no bugs. I had the player write out the cords for where he wanted ...
2
votes
5answers
71 views
First element in array
Why do indexes in arrays always start with 0? Does it have something to do with binary? For example:
var myArray = [5,6,7,8];
To access the number 5, you would have to say
myArray[0]
But why?
...
0
votes
2answers
19 views
TypeError: Converting circular structure to JSON: Is there any way to ignore this warning?
I am trying to send a complex data structure composed of objects with arrays that have object with arrays that have object with arrays that may point to the first object, etc... and I get this error: ...
0
votes
1answer
31 views
Access javascript Array in HTML
I am creating a mobile app. I have a javascript file language.js having the following code
var lang=new Array();
lang[0]="English";
lang[1]="Chinese";
lang[2]="Korean";
I want to create ...
0
votes
1answer
28 views
Create an array in jQuery to advance through image gallery
So, I've created this website that has an image gallery using some aspects of Superbox, but my client would now like to be able to advance through the gallery rather than merely clicking on the images ...
0
votes
1answer
32 views
Remove an object from array with objects and functions
I have an object array:
[
{ name: 'one', value: '1' },
{ name: 'two', value: '22' },
{ name: 'three', value: '333' },
add: [Function],
delete: [Function]
]
How can I ...
-2
votes
2answers
45 views
how to create an array in javascript with values of a resultset
I want to pass the values of the resultset obtained from JSP to arrays in Javascript. Please help me.
JSP code that fetches data from database:
ResultSet resultset12 =
...
0
votes
2answers
13 views
How to use asp vbscript to add string items into a javascript array
According to jquery ui API, the source of an autocomplete field may be an array variable. How can I populate the array variable with results from a vbscript recordset result?
In the body of my page ...
1
vote
1answer
30 views
Declare min and max values from a CSV
I wish to be able to determine the minimum and maximum for each series in the below (series being pH, ORP, Tank, Heater and Room). Tank, Heater and Room should all be written to the same min and max ...
-6
votes
1answer
56 views
How can I create a 1 x 26 array of 1's and 0's to represent a word [on hold]
I would like to create a 1 x 26 array that represents a word, where 1's appear in the array value of the letter. for instance, the word 'abets' would be represented by the array
...
0
votes
1answer
14 views
Recalling data from a JSON array in Javascript error
I managed to get the JSON array into (look http://yrs2013.bugs3.com/mpapp/getSTORY.php?url=http%3A%2F%2Fcontent.guardianapis.com%2Fsearch%3Fq%3DJohn%20Stevenson%20mp%26page-size%3D3%26format%3Djson ...