Tagged Questions
0
votes
0answers
13 views
Fancybox with Video Array
I am trying to have Fancybox open up from the individual video links I have being displayed next to all of my h3 tags on a page I am developing.
I have tried many solutions and even involved other ...
0
votes
2answers
32 views
Arrays disappear outside of JSON request
I am attempting to set up an array with the various properties of a YouTube video (you may be thinking this is somewhat superfluous, however I am planning on adding other sources in the future). I am ...
0
votes
2answers
50 views
match two arrays or objects in javascript
I have two javascript objects
var category = new Object();
I add some attributes to the object as
category.Hot = "Red";
category.Cold = "Blue";
category.Warm = "Yellow";
I have another object ...
1
vote
0answers
41 views
javascript rearrange arrays in permutations for jquery selectors
Not sure of the best title for this question so any revision suggestions welcome...
say i have 1 javascript array that look like this:
group[g1] = [v1,v2,v3]
group[g2] = [a1,a2,a3]
group[g3] = ...
0
votes
1answer
31 views
How to set preselected options into a multiple select tag according to a php array
I have made a multiple select tag and I would like some of its options to be selected according to given PHP array $attr
<select multiple="multiple" name="isattr[]" id="editAttr">
<?php ...
0
votes
2answers
45 views
Jquery Random Array Delete
var items = ["1","2","3","4","5","6","7","8","9","10","11","12"];
function bigger(){
for(var i=0;i<items.length;i++){
a = [Math.floor(Math.random() * items.length)+1];
scale(a); ...
-2
votes
2answers
40 views
How to combine array element that starts with same text in javascript
I have an array called ItemArray which has elements as below
ItemArray[0]='44@Man'
ItemArray[1]='45@Cotton'
ItemArray[2]='44@Woman'
and what i want that new array should be NewItemArray as below
...
0
votes
3answers
43 views
Why does the each() end after it goes through array?
I have this script below and I want it to loop through each anchor and give the background
$c = ['85CC4C', 'D1FFCD', 'FF8D9D', '8A5949', 'CC8066'];
$('a').each(function(i){
...
0
votes
3answers
81 views
Javascript array [duplicate]
Im am working with some code from another developer and came across something I have not seen before. The basic functionality of the code is to look for a piece of data in an object within an object. ...
1
vote
2answers
65 views
Why / when does $.inArray return -1?
I was wondering why / when -1 is used in JavaScript or jQuery, respectively.
I'm using this snippet:
if ($.inArray('false', answers) > -1) {
window.console.log('you Lose!');
}
Cheers,
Chris
6
votes
2answers
89 views
How to get unique array of objects in javascripts [duplicate]
I want to get array having unique objects.
Say I have array of objects
[{"a":"b"},{"c":"d"},{"a":"b"}]
and I want unique value of array i.e
[{"a":"b"},{"c":"d"}]
is there any simplest way to ...
0
votes
3answers
55 views
jQuery random count with no number repeat until end of loop
I've been trying hard at this. A jQuery counter function that counts from 0 to 6 continuously in random but no repeat of a number until end of the loop i.e. until the count of the 7th digit in the ...
3
votes
3answers
40 views
How can I use the data the is return from the Ajax?
I am using ajax to retrieve data from my database and store it as an array, then I return the result. My goal is, when the users click the "Click Me" button. I want to alert the first array from the ...
0
votes
0answers
29 views
scope of array (array refreshes with page refresh)
I have this code:
application.js
var userArray = [];
$(document).ready(function() {
$("#signupform").submit(function(e) {
var user = {
name: $('#pname').val(),
...
0
votes
1answer
45 views
Array resorting
I have a list items from which some of them are missing, like for example, here 3rd in order is missing:
<ol>
<li data-id='0'>Apple</li>
<li ...