I'm trying to loop over all JavaScript variables to find ones that match a certain regex. The function works fine in every browser but IE, it appears that the for loop ... |
I am running a loop, and I am trying to create a variable each time the loop runs with the number of the counter appended to the end of the variable ... |
I have a slide show where every 10 seconds the next image loads. Once an image loads, it waits 10 seconds (setTimeout) and then calls a function which fades it out, ... |
I'm trying to define variables within a loop. I'll drop the code here and then try and explain some more:
for (var k=0; k<nodes.length; k++){
this[node+k] = new google.maps.Marker({
...
|
I'm trying to get this to work and I hope this isn't too vague. -Chris
var example = new Array();
var test1 = "one";
var test2 = "two";
var test3 = "three";
for ...
|
Imagine i had: <div id names>142,140,150</names>
could i then (in Javascript) write a forloop which declares variable names, with these values appended ie
var list = document.getElementById('names').innerHTML.Split(',');
for(i=0; i<list.Length; i++){
var ...
|
I know that probably would be the dumbest question to ask, but its a desperate attempt from a UI guy to do something... i have getting some values from a json ... |
|
Here is the code:
<script type="text/javascript">
var offender_locations = [
["10010", "xxxxx", 3],
["10001", "xxxxx", 2],
["10002", "zzzzz", 1]
];
for (i = 0; i < offender_locations.length; i++) {
var address = offender_locations[i][0];
var ...
|
I would like to specify the while's condition as a variable, something like:
function doWhile(condition){
while(condition){
number++;
}
...
|
I have an issue where I have recursion inside of a for loop:
function func(node) {
for(var i = 0; i < node.children.length; i++) {
...
|
How can I use a for loop to dynamically create variables, and be returned.
function createVariables()
{
for ( i=0; i<=20; i++ )
{
...
|
var Top = 5;
for(var i=0;i<3;i++) {
var Model = createView("First ModelView", Top, 135);
}
Initially the Top = 5, for each iterating ... |
This seems pretty basic, but I can't find the best method to do this... I'm trying to set up a function that loops between a user selected start and end variables. ... |
I'm trying to make a for loop that depending on the objNumber variable. It makes that many objects and names them with different variables, like so:
for (var i = 1; i ...
|
Why second FOR loop don't work ?
toget = new Array("var18", "var4", "var43");
for (var i=0; i < toget.length; i++) {
for (var x=0; x < result.toget[i].list.length; x++) {
...
|
Let's say I have something as follows:
for(var i = 0; i < length; i++){
var variable = variables[i];
otherVariable.doSomething(variable, function(err){ //callback for when doSomething ends
do ...
|
The title plus the following example are self-explanatory of what I don't achieve :-)
The idea is to replace something + counter in order to make it work.
...
|
What are the differences of that iterations:
var recordId;
for(recordId in deleteIds){
...
}
and
for(var recordId in deleteIds){
...
}
It says implicit definition(what is it), is there a performance difference between them?
|
using extend script to push a variable into an array it's basically javascript. any idea what I am doing wrong?
if ( app.documents.length > 0 ) {
for ( ...
|
what is the correct syntax to do this ? Basically i want increment the name of the variable.
for (i=0; i<5; i++) {
eval("var slider_" ...
|
In this simple example function:
doSomething = function(withThisId) {
var videos = getVideos(), // array of videos
discovered = false
...
|
I'm following this tutorial: http://vimeo.com/16961179 that teaches you how to make views and partials with express.js:
var products = [
{
id: 1,
...
|
Okay, I'm still seeing issues with this (oh, and sorry, I didn't see your post Logic Ali - that is simpler than what I was doing). So totalSteps is the total number of times the loop should run. In the test page I'm working with totalSteps is 10. However, when I use (i < totalSteps), it returns only nine links. (i ... |
Hi all, Below is a simple script (adapted from http://forums.asp.net/p/1037158/1453597.aspx) which allows me to drop clones of an object into a table; however, I'd like to have (value="101") set to the value of "cond", as well as "addncomment101. Also, I need to use some kind of array to track which cells of the table have been filled. I'd like to use ... |
i am trying to loop through a bunch of questions. they are numbered from Question1-10 and the questions is the same so i am trying to see how many yes answers i got. for(k=1;k<10;k++) { count=0; if(form.Question+k+.value=="yes") count++; } this is what i thought would work, but it doesnt like the +k+ thing. I have used that in the past in ... |
It does not list object properties or methods implicitly defined in an object with the var or function keywords. (In client-side JavaScript, defining a variable with var is the same as defining a property of the same name in the current Window object, except for the different treatment of these two cases by the for/in loop.) Properties implicitly defined by the ... |
|
var menuItems; var menuDTItems; var menuCounter; function clearMenuText( ) { document.getElementById('menuText').innerHTML = " "; } function setMenuText( someText ) { document.getElementById('menuText').innerHTML = someText; } function initialiseMenu( ) { menuItems = document.getElementById('menu').getElementsByTagName('dl')[0]; menuDTItems = menuItems.getElementsByTagName('dt'); for ( menuCounter = 0; menuCounter < menuDTItems.length; menuCounter++ ) { var dtItem = menuDTItems[menuCounter]; dtItem.getElementsByTagName('a')[0].onmouseout = clearMenuText; dtItem.getElementsByTagName('a')[0].onmouseover = function() { setMenuText( dtItem.nextSibling.innerHTML ); }; } } ... |
|
|
function test_fields(form){ var found_it = "error" //initial value is null because we gave it no other value for (var i=0; i |
|
|
ive got a for loop which grabs values from form fields and puts them into a variable, is there a way in which i can add the different values of a variable into another variable which i can then output to a "total" form field? here is some code that i have: Code: tot = total number of form fields that ... |
thanks for the tip. This function will actually trim them before sending to the db right. The reason that I ask is that I performed the trim on the form variables seperately and it seemed that they still made it through without being affected. Although I noticed that you used trm() and I used trim(). Is that a typo or is ... |
i need a way to create a loop that will create a variable that i can increment by one each time..... something like this for (var i = 1; i < source.length; i++) { var increment_this = document.getElementById('this_element' + i); } what i am trying to accomplish is that i have a function that uses ... |
|
|
function popup() { var urls = document.p.elements["url[]"]; var times = document.p.elements["time[]"]; var types = document.p.elements["type[]"]; var output = []; var counters = document.p.elements["counter[]"]; resObjekt.open('POST', '/test.php' ,true); resObjekt.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"); resObjekt.onreadystatechange = handleResponse; alert(output.length); for(var i=0;i<=urls.length;i++) { var output = output + urls[i].value + ':' + times[i].value + ':' + types[i].value + ':' + counters[i].value + ';'; } str = 'command=' + output; ... |
In js code, strings are written with quotes around them and "references" to html elements are written without quotes around them. You write: window.opener.document not "window"."opener"."document" Don't confuse how strings are displayed(i.e. without quotes) with the way they are written in js code. document and "document" are not the same thing in js. To demonstrate that difference, run this code: Code: ... |
|
|
|
|