Tagged Questions
0
votes
0answers
8 views
access the tableRow id value by iterating over the whole table in Javascript
I want to move the tableRow upwards in a html table if the user clicks on it.
Here is the html:
<tr id="duration_row" onclick="moveUp('duration_row', 'sort_table')">
I decided to write my own ...
2
votes
5answers
53 views
Which for loop should I use for JavaScript arrays and objects? [duplicate]
I always use for (i=0; i<array.length; i++) when looping through arrays.
I always use for (var i in object) when looping through object properties.
I can't use for (i=0; ... ) for object ...
-1
votes
3answers
47 views
Extract values from a multidimensional arrays with js
What is the easiest to understand solution to get out the values as follows:
Bill, Smith, 32
Sarah, Lord, 28
I only got this far:
HTML
<a href="#" ...
-5
votes
0answers
72 views
Array vs 'for' loop (javascript) [closed]
I'm new to JavaScript and I'm having trouble understanding this sample code for a Q&A mobile app. The following code is for the question page of the mobile app:
for(var i = 0; i < ...
0
votes
0answers
71 views
Javascript / JQuery loop
I am trying to make this code
var cbEarned = (parseInt(spending1) * parseFloat(cashBack1 / 100)) + (parseInt(spending2) * parseFloat(cashBack2 / 100)) + (parseInt(spending3) * parseFloat(cashBack3 / ...
0
votes
1answer
55 views
Javascript countdown not working for php loop
Hello i me and a friend have a maffia game. I have a countdown timer code but it only works when i use one timer. But i need to use it in a loop to get more timers in a table. I searched on google but ...
1
vote
1answer
29 views
Table generated in by Javascript not displaying
This table is not displaying in my html file: can anyone see an obvious mistake? I've been staring at it for hours!
<div id="data_list">
<script type="text/javascript">
...
-1
votes
1answer
52 views
How to loop inside a json file with javascript?
I have a json file returned on my javascript code. The file looks like this :
{
"data": [
{
"id": "594984240522886",
"from": {
"id": ...
0
votes
0answers
23 views
How to make a loop for multiple plupload
I have a piece of code like that:
$(function() {
var uploader1 = new plupload.Uploader({
runtimes : 'gears,html5,flash,silverlight,browserplus',
browse_button : 'pickfiles1',
container : ...
1
vote
3answers
59 views
How to make a setTimeout function continuously loop?
How can I make a setTimeout function continuously loop?
For example
setTimeout(function(){
$(".slide2").hide();
$(".slide").show();
setTimeout(function(){
...
1
vote
2answers
32 views
calling the selected loop element in a method in a .onclick function
I tried to call the method addProject() with the the second argument as current selected element in the loop. But the reference of the argument is null, when I called addProject().
I think the ...
0
votes
1answer
51 views
php loop through scripts array & remove item
I have the following script in my cms page:
window.addEvent('domready', function () {
SqueezeBox.initialize({});
SqueezeBox.assign($$('a.modal'), {
parse: 'rel'
});
});
var ...
0
votes
1answer
36 views
Redefine a function after it is created in Javascript
I'm creating through a PHP loop (the reason of the loop is because I want more or less cases) a switch Javascript function, that outputs this:
function my_function(array_name) {
switch (true) {
...
1
vote
3answers
50 views
Iterate over associative arrays inside an indexed array
I'm learning JS and have to do a trivia game, where each question has 4 possible answers. The questions are given to me in a string with "#", which separates the questions, and "@", which separates ...
1
vote
1answer
49 views
insertbefore() in loop only adds the first row, fails on the others
I am using Greasemonkey and JavaScript to write annotations for a web page. I want to add the same <td> to multiple rows, but the code only works for the first row.
Here is what I have:
var ...