IE With Nested Loops Isn't Working
Nov 21, 2009
I really can't figure out why it's not working in IE. The only problem I can think of would be using nested loops. Here's the part of the code that isn't working. It's not generating an error, it's just not returning anything. I know you guys hate when I post entire code, so I trimmed it down as much as I can. It's referring to an already stated xml document with xmlDoc. And it's goal is to return a table of rows that meet certain criteria. If you can see any syntax errors that explorer would not like, that's really what I'm asking for.
[Code]...
View 6 Replies
ADVERTISEMENT
Feb 27, 2010
I have to create a pyramid with nested for loops in javascript. This wasn't a problem until my professor asked us to mirror the pyramid. this is the code i have so far:
<script>
This part of the program works. What I'm having trouble with, is placing spaces and x's on the left side so that the triangle appears like:
I saw a few thread that had the right half of this triangle upside down, but I couldn't figure out how to flip it and fill in the other side. I'll attach the .html file so people can run what I have so far.
View 1 Replies
View Related
Nov 15, 2010
I'm having trouble getting this nested loop to work. It only outputs the last image and I want it to loop through the images.
[Code]...
View 2 Replies
View Related
May 7, 2009
I am trying to make an application that displays a pattern of asterisks a certain way. the only output statements I could use are to get the pattern below. My question would be which way to use the nested loop, (do i do while(if else)...
[Code]...
View 10 Replies
View Related
Sep 23, 2010
i am having trouble with a program for class hoping someone can point me in the right direction i am supposed to use nested for loops to output 2 seperate webpages one with the first pattern below and then another with the second pattern.
[Code]...
View 17 Replies
View Related
Apr 8, 2011
Having a tough time integrating the 2. Trying to create 2 loops, the inner one I had working as below, until I tried to add the outer loop which iterates through the tables
<script type="text/javascript">
// <![CDATA[
var i=0;
[code]....
View 7 Replies
View Related
Oct 1, 2011
this is code for a conway's game of life. the nested loop on stepGen() doesnt work and i cant figure out what it is. no syntax errors, or anything. i put alert statements to see whats happening. i can provide the rest of the code if necessary.[code]
View 2 Replies
View Related
Sep 16, 2009
full sample script which demonstrates the problem, inner tabs company/department come up as list instead of tabs.I have already tried what People have suggested that inner tabs should also be tabified via jquery but it doesn't work all the examples I have seen e.g.URL... use topmost div for jquery tabs call.[code]
View 6 Replies
View Related
Aug 1, 2011
I have some set of div elements as follows,
<div class="parentCell_1">
<div class="children"></div>
<div class="children"></div>
[code]....
View 4 Replies
View Related
Nov 4, 2007
i am trying to do but I have no clue how to write it. Im trying to write a while loop that prints out all of the multiples of 5 between 10 and 95. I just need to know how to write the while loop i got everything else.
View 1 Replies
View Related
Feb 6, 2006
I'm my script I've three loops processing a very huge data file. IE & Firefox show a message box after some time saying my script could be infinite looping and give me a chance to stop it.
Is there a way to prevent this dialog box to show up? I'm writing a script used only on a intranet and the final customer should not see the message box.
View 6 Replies
View Related
Jan 12, 2007
Hi, I want to have something like this:
function callme1() {
alert('somestuff');
}
function callme2() {
alert('somestuff');
}
function callme3() {
alert('somestuff');
}
function callme4() {
alert('somestuff');
}
etc.
except, it's going to be created in a loop, like
var x=0;
while (x<10) {
function callme[x]() {
alert('somestuff');
}
x++
}
So, out of that I would like to get 10 callme(1-10 or A-J) functions...
I guess I am lost which way to build this with the placement & parsing
of the variables.
View 3 Replies
View Related
Jun 6, 2009
Is it possible, when you have a loop in a loop, that when the inner loop reaches a certain point, it breaks out of both loops? For example:
[Code]....
The code above will break out of the (b=0;b<=10;b++) loop when b==5, but it will continue to do the a loop. not putting the first loop at all or making the first loop stop at 1): Is there a way to break out of both loops when the if condition is met? (I only ask that you not give a work-around because what I have in mind is much more complicated than this)
View 3 Replies
View Related
Dec 15, 2007
i'm scratching my head over achieving similar results with setInterval() function, and how I can keep it from looping infinitely.
I want to do something like this:
var i = 0;
var endTime = now + ((1000*60)*2); // 2 minutes after now
while (now <=endTime) {
i = i + 1;
now = new Date().getTime();
}
document.write("total iterations: " + i);
however you can't do this because of lag issues, so i'll settle for using setinterval on its smallest interval of a millisecond, here is my attempt to translate the above to a setinterval solution:
var endTime = now + ((1000*60)*2); // 2 minutes after now
var intervalID = setInterval(loopFunc(endTime),1);
function loopFunc(endTime,intervalID) {
if (new Date().getTime() <= endTime) {
i = i + 1;
} else {
clearInterval(intervalID);
}}
as you can see I have prolbems figuring out how to stop the interval from continuing to iterate, and passing the interval id, I'm clueless Also I'm clueless on echoing the total iterations via this method.
View 4 Replies
View Related
Nov 8, 2009
I want to get averages from a for loop. Let's say I had a # of exams and in that loop I wanted to add the exams up and calculate the average. How would I go about doing this? Is this even possible in a for loop?
View 1 Replies
View Related
Jul 26, 2009
If I were to have a script:
Code JavaScript:
var numbers = [1, 2, 3, 4, 5];
var incrementer = 0;
while (incrementer < numbers.length)
{
[Code]...
View 1 Replies
View Related
Jul 20, 2005
I have got a span inside a td of a table. i am trying to clip the
string that exceeds the length of the td and then put three dots
("...") after it so it will show that the text was clipped and when
the mouse hovers above it, it will show the title. now i have managed
to do all the above by puting a span inside the td with the style
overflow:hidden and it all works fine. to add the three dots i have to
clip the string to ten pixels below the length of the td and then add
the dots. i can do it by slicing the string in "string.length-1" each
time and then get the new length of the string with offsetWidth, and
when getting to the right length - add the dots. the problem is that
the slicing is done in a "while" loop, and when having a very long
table it takes too much time. the question is if there is any methods
of clipping the string by pixels or any other method that will shorten
the run time of the script.
p.s.
i tried also having another span with the three dots that is
display:none and when the length exceeds the span length (the length
of the span is set to the td-10px) i change the display to block, but
the second span keeps on droping a line which is not good for me.
View 3 Replies
View Related
Nov 30, 2011
I'm making a page which gets the contents of an xml file and creates a table and populates it. The problem is when it loops around it seems to strip everything from the page HTML, HEAD, BODY tags and everything inside of those and just puts the value of the elements from the xml file onto the page. My question is, am I able to perform this loop and keep the rest of the contents of the page intact? I've been trying for most of the day and I can't get this working.
[Code]...
View 1 Replies
View Related
Nov 29, 2005
I would like to have two buttons on the page. When visitor clicks on first, I would like to start looping through numbers for example from 1 to 100. When loop gets to the end, I would like to start it over and stop it when user click on the next button.
My concern is if this is safe. What if user waits for 1 minute or more to click the second button which should stop the loop and pick up the number where it currenly is? Will it cause browser to warn user that the script is slowing down the browser? How can I avoid this?
View 11 Replies
View Related
Jul 11, 2010
While arr[i] works fine in a loop, the addition of another dimension...arr[0][i]...means that it will not accept an assigned value.
View 12 Replies
View Related
Aug 16, 2010
point out where my logic is flawed in this? Or where my scripting is wrong?I'm trying to build a standard HTML table with 5 columns across and as many rows down as necessary, to fit all of the images in an array (brought into the DOM via PHP).My goal is to have rows of 5 columns that add on to accomodate up to 50 total images (10 rows).Here's my logic (flawed or not):*Look at the number of tems in the array*If the number is greater than 5, build one full row (of 5 <td>s)*Check again - is the number of items in the array greater than 10?*Build another row*If not, build a partial row, and fill in the rest of the <td>s (less than a full row) with blank spaces.The question is whether or not my logic is being represented in the javascript?unctions in <head>calls to function on lines 149-159Don't mind the formatting, I've blown it up so I can see what's going on.
View 4 Replies
View Related
Dec 6, 2011
I want to start of by saying, i dont know much when it comes to javascript. I am trying to set variables up and call them in 2 while loops (one to set the variable, one later to try to call for it since I am putting it in an array) as I dont know how many I will be using when this code runs. To help understand what needs to be accomplihsed, I have commented out code on what I need to do, and left code beside it on what the sample is that actually works. I hope this is clear on what needs done.
HTML Code:
<script type="text/javascript">
var long_array=new Array();
[code]....
View 5 Replies
View Related
Jun 25, 2010
I am having trouble with a project i am supposed to be doing which is to turn structured English into coding joined with the code i am about to post !This is the code i have written so far that works:
var contestantNamesArray = ['Tom and Nazia', 'Pat and Dan', 'Sandra and Kofi', 'Ian and Adele', 'Paul and Costas'];
var judgesPointsArray = [2,1,5,4,3];[code].....
I have tried myself but i am stuck at how to link the contestantNamesArray with the rest of the code in order to be able to display the couples who scored the maximum points and store it in a new variable and then write out the names.
View 10 Replies
View Related
Nov 28, 2010
We have created this function with loops and arrays Problem is the loops work only when I take out the function when the function is in place, nothing works, it is part of exercise
here is my code
title>Congressional Races</title>
<link href="results.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="votes.js"></script>
<script type="text/javascript">
[Code]...
View 5 Replies
View Related
Oct 26, 2011
I've now got to form an average of snowfall inputs, taken from looped prompts, however I'm not allowed to use arrays or functions...Almost every example I see uses arrays, such as this one here:http://www.codingforums.com/showthread.php?t=4313Is it possible to not use arrays to form the average? Please describe how to do this in general terms, as was highlighted in that link ^^^ I want to learn, not copy, although one can be derived from the other...What I haveso far, assume all vars have been announced.
for (var d=1; d<=numofinputs; d=d+1)
{
input = prompt("Enter a data input" + d)
}
View 4 Replies
View Related
Oct 26, 2009
I am trying to make a hollow square for loops this is what i got but i dont want my loop to go infinite i just want my loop to stop after first time.
<html>
<head>
<script type="text/javascript">
var squareSize;
[Code].....
View 8 Replies
View Related